Skip to content

Conversation

@knorrium
Copy link
Member

One more

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the GitHub Actions workflow from only setting PR review status to a comprehensive project board automation system that handles both pull requests and issues.

Changes:

  • Adds automatic addition of newly opened issues to project board #8
  • Implements draft PR detection to skip status updates for draft pull requests
  • Renames workflow and job to reflect broader scope

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +53
const alreadyInProject = errors.some(e =>
typeof e.message === 'string' &&
e.message.toLowerCase().includes('already') &&
e.message.toLowerCase().includes('project')
);
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error detection logic for "already in project" is fragile because it relies on string matching against error messages that may vary or change. The logic checks if both "already" and "project" appear in the error message, which could produce false positives. Consider checking for more specific error codes or types if available in the GitHub GraphQL API error responses, or at minimum use a more precise error message pattern.

Suggested change
const alreadyInProject = errors.some(e =>
typeof e.message === 'string' &&
e.message.toLowerCase().includes('already') &&
e.message.toLowerCase().includes('project')
);
const alreadyInProject = errors.some(e => {
if (typeof e.message !== 'string') return false;
const msg = e.message.toLowerCase();
return msg.includes('already exists in project') ||
msg.includes('content already exists in project');
});

Copilot uses AI. Check for mistakes.
contentId: context.payload.issue.node_id
});

console.log('Successfully added issue to project #8');
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded project number "8" in the console log message is inconsistent with using PROJECT_ID from secrets. If the project number changes or this workflow is reused for a different project, the log message will be misleading. Consider using a variable or more generic message.

Copilot uses AI. Check for mistakes.
);

if (alreadyInProject) {
console.log('Issue is already in project #8, skipping add.');
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded project number "8" in the console log message is inconsistent with using PROJECT_ID from secrets. If the project number changes or this workflow is reused for a different project, the log message will be misleading. Consider using a variable or more generic message.

Copilot uses AI. Check for mistakes.
if (alreadyInProject) {
console.log('Issue is already in project #8, skipping add.');
} else {
console.error('Failed to add issue to project #8:', error);
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded project number "8" in the console log message is inconsistent with using PROJECT_ID from secrets. If the project number changes or this workflow is reused for a different project, the log message will be misleading. Consider using a variable or more generic message.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants