Repository navigation
chore(ci): comment on a discussion when the PR implementing it merges #61
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,17 @@ | ||
| name: link-discussion | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fork PRs cannot update discussionsMedium Severity The Reviewed by Cursor Bugbot for commit 95ab9db. Configure here. |
||
|
|
||
| jobs: | ||
| link-discussion: | ||
| if: github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| discussions: write | ||
| pull-requests: read | ||
| steps: | ||
| - uses: jdx/link-discussion-action@38e7537b4b00d6b04a08de54c2f38b3001c9cd8d # v0.1 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||


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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: jdx/ruby
Length of output: 777
🌐 Web query:
GitHub Actions pull_request closed merged payload empty fork GITHUB_TOKEN read-only pull_request_target closed documentation💡 Result:
<source_evidence>
Citations:
🏁 Script executed:
Repository: jdx/ruby
Length of output: 13431
Use
pull_request_targetfor this post-merge workflow.GitHub provides an empty
pull_requestpayload for merged pull requests and fork-origin pull requests. The merged guard therefore evaluates false and skips the job, so the pinned action never processes references or posts discussion comments and closures. Fork-originpull_requestruns also receive a read-onlyGITHUB_TOKEN, which cannot usediscussions: write.Change the trigger to
pull_request_targetand keep the merged guard. Do not check out or execute pull request code. This action only reads the event payload and performs the required GraphQL mutations.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents