-
Notifications
You must be signed in to change notification settings - Fork 138
Added Workflow for Sync in issue and PR #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||||||||||
| name: Sync PR data from Linked Issues | ||||||||||||
|
|
||||||||||||
| on: | ||||||||||||
| pull_request: | ||||||||||||
| types: [opened, edited, synchronize] | ||||||||||||
|
|
||||||||||||
| jobs: | ||||||||||||
| sync-metadata: | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
|
|
||||||||||||
| permissions: | ||||||||||||
| issues: write | ||||||||||||
| pull-requests: write | ||||||||||||
|
|
||||||||||||
| steps: | ||||||||||||
| - name: Extract Linked Issues | ||||||||||||
| id: extract | ||||||||||||
| uses: actions/github-script@v7 | ||||||||||||
| with: | ||||||||||||
| script: | | ||||||||||||
| const body = context.payload.pull_request.body || ""; | ||||||||||||
| const issuePattern = /#(\d+)/g; | ||||||||||||
|
||||||||||||
| const issuePattern = /#(\d+)/g; | |
| const issuePattern = /\b(?:fixe?s|close[sd]?|resolve[sd]?)[:\s]+#(\d+)/gi; |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern /#(\d+)/g will match any #number format, but GitHub's issue linking requires specific keywords like 'fixes', 'closes', 'resolves' followed by the issue number. This could incorrectly match unrelated hash numbers in the PR body.
| const issuePattern = /#(\d+)/g; | |
| // Match "fixes #123", "closes: #456", "resolves #789", etc. (case-insensitive) | |
| const issuePattern = /\b(?:fixe?[sd]?|close[sd]?|resolve[sd]?)\s*[: ]+\s*#(\d+)/gi; |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script tries to get input 'issues' but it should use the output from the previous step. Use steps.extract.outputs.issues instead of core.getInput('issues').
| const issuesInput = core.getInput("issues") || "[]"; | |
| const issuesInput = process.env.ISSUES || "[]"; |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core.getInput("issues") call will not retrieve the output from the previous step. It should be steps.extract.outputs.issues to access the output from the extract step.
| const issuesInput = core.getInput("issues") || "[]"; | |
| const issuesInput = steps.extract.outputs.issues || "[]"; |
Uh oh!
There was an error while loading. Please reload this page.