Skip to content

Add additional Copilot user variations to PR issue link exemptions#685

Merged
A1L13N merged 2 commits into
mainfrom
copilot/fix-22b43639-5590-47c1-8b93-79b4eef4c2f5
Oct 4, 2025
Merged

Add additional Copilot user variations to PR issue link exemptions#685
A1L13N merged 2 commits into
mainfrom
copilot/fix-22b43639-5590-47c1-8b93-79b4eef4c2f5

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 4, 2025

Problem

The enforce-issue-linked-pr.yml GitHub Action workflow was closing PRs created by GitHub Copilot because it only recognized bot-suffixed Copilot usernames (copilot[bot], github-copilot[bot], etc.) in the exempt users list. However, Copilot can also create PRs with the username Copilot (without the [bot] suffix), causing legitimate Copilot-generated PRs to be automatically closed for missing issue links.

Solution

Updated the exempt users list to include additional Copilot username variations:

  • Copilot - Copilot user without bot suffix
  • copilot - Lowercase variant

Changes

Modified .github/workflows/enforce-issue-linked-pr.yml to expand the exemptUsers array from:

const exemptUsers = ['A1L13N', 'copilot-swe-agent[bot]', 'copilot[bot]', 'github-copilot[bot]'];

to:

const exemptUsers = ['A1L13N', 'Copilot', 'copilot', 'copilot-swe-agent[bot]', 'copilot[bot]', 'github-copilot[bot]'];

This ensures that PRs created by GitHub Copilot with any username format will be properly exempted from the issue link requirement, preventing them from being automatically closed.

Testing

  • ✅ YAML syntax validated
  • ✅ Minimal change preserving existing functionality
  • ✅ Consistent with existing code patterns
Original prompt

update this github action to also bypass for copilot with:
github-token: ***
script: const pr = context.payload.pull_request;
const prNumber = pr.number;
const repo = context.repo;

console.log(Checking PR #${prNumber} for linked issues in Development section);

// Check for exempt users
const exemptUsers = ['A1L13N'];
if (exemptUsers.includes(pr.user.login)) {
console.log(PR author ${pr.user.login} is exempt from issue link requirement);
return;
}

// Check for exempt labels
const exemptLabels = ['dependencies', 'documentation', 'typo', 'ci', 'chore'];
const hasExemptLabel = pr.labels?.some(label => exemptLabels.includes(label.name.toLowerCase()));
if (hasExemptLabel) {
console.log(PR has exempt label, skipping issue link check);
return;
}

// Check for exempt title prefixes
const exemptPrefixes = ['docs:', 'chore:', 'deps:', 'ci:'];
if (exemptPrefixes.some(prefix => pr.title.toLowerCase().startsWith(prefix))) {
console.log(PR has exempt prefix in title, skipping issue link check);
return;
}

// Check linked issues in the Development section using GraphQL
try {

debug: false
user-agent: actions/github-script
result-encoding: json
retries: 0
retry-exempt-status-codes: 400,401,403,404,422

Checking PR #680 for linked issues in Development section
No issues linked via the Development section
Already commented about missing link, skipping duplicate comment
Closed PR #680 due to missing Development section link


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 4, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copilot AI changed the title update this github action to also bypass for copilot with: github-token: *** script: const pr = context.payload.pull_request; const prNumber = pr.number; const repo = context.repo; console.log(`Checking PR #${prNumber} for linked issue... Add additional Copilot user variations to PR issue link exemptions Oct 4, 2025
Copilot AI requested a review from A1L13N October 4, 2025 21:52
@A1L13N A1L13N marked this pull request as ready for review October 4, 2025 21:57
@A1L13N A1L13N merged commit b609678 into main Oct 4, 2025
1 check passed
@A1L13N A1L13N deleted the copilot/fix-22b43639-5590-47c1-8b93-79b4eef4c2f5 branch October 4, 2025 21:57
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