Skip to content

Commit 40f807a

Browse files
Fix skip-issue-check to support short issue references (#123) (#25260)
Updates the PR issue check to recognize both full GitHub issue URLs and short issue references in the format `#123`. ## Problem Currently, the `skip-issue-check` workflow only accepts full GitHub issue URLs like `https://github.com/microsoft/vscode-python/issues/123` in PR descriptions. Contributors using the more common short format like `#123` would need to add the `skip-issue-check` label to bypass the check. ## Solution Modified the GitHub Actions script in `.github/workflows/pr-file-check.yml` to check for both formats: - Full URLs: `https://github.com/microsoft/vscode-python/issues/123` (existing behavior) - Short references: `#123` (new behavior) The check now passes if either format is found in the PR description. ## Changes - Added regex pattern `/#\d+/` to match short issue references - Updated condition to pass if either format is detected: `if (!issueLink && !issueReference)` - Maintains backward compatibility and existing `skip-issue-check` label behavior ## Testing Verified the updated logic handles all scenarios correctly: - ✅ Full GitHub URLs (existing) - ✅ Short format like `#123` (new) - ✅ Both formats in same PR description - ✅ Multiple short references - ✅ Skip label behavior unchanged - ❌ No issue references (correctly fails) - ❌ Invalid formats like `#` without numbers (correctly fails) Fixes #25259. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to start the survey. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: eleanorjboyd <[email protected]>
1 parent 9d0aab5 commit 40f807a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/pr-file-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ jobs:
5151
if (!labels.includes('skip-issue-check')) {
5252
const prBody = context.payload.pull_request.body || '';
5353
const issueLink = prBody.match(/https:\/\/github\.com\/\S+\/issues\/\d+/);
54-
if (!issueLink) {
54+
const issueReference = prBody.match(/#\d+/);
55+
if (!issueLink && !issueReference) {
5556
core.setFailed('No associated issue found in the PR description.');
5657
}
5758
}

0 commit comments

Comments
 (0)