-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ci: update conflict predictor comment action #7316
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 2 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 |
|---|---|---|
|
|
@@ -8,11 +8,11 @@ on: | |
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write # mshick/add-pr-comment updates PR conversation comments via the Issues API | ||
|
Author
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. 💬 Nitpick: issues: write may not be required; sibling workflow runs v3 with only pull-requests: write The sibling source: ['claude'] 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.
Because this workflow runs on Useful? React with 👍 / 👎. |
||
| # Enforce other not needed permissions are off | ||
| actions: none | ||
| checks: none | ||
| deployments: none | ||
| issues: none | ||
| packages: none | ||
| repository-projects: none | ||
| security-events: none | ||
|
|
@@ -35,7 +35,7 @@ jobs: | |
| continue-on-error: true | ||
| - name: Post conflict comment | ||
| if: steps.validate_conflicts.outputs.has_conflicts == 'true' | ||
| uses: mshick/add-pr-comment@v2 | ||
| uses: mshick/add-pr-comment@v3 | ||
| with: | ||
| message-id: conflict-prediction | ||
| message: | | ||
|
|
@@ -48,7 +48,7 @@ jobs: | |
| Please coordinate with the authors of these PRs to avoid merge conflicts. | ||
| - name: Remove conflict comment if no conflicts | ||
| if: steps.validate_conflicts.outputs.has_conflicts == 'false' | ||
| uses: mshick/add-pr-comment@v2 | ||
| uses: mshick/add-pr-comment@v3 | ||
| with: | ||
| message-id: conflict-prediction | ||
| message: | | ||
|
|
||
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.
🟡 Suggestion: Inconsistent permission scope vs. sibling merge-check.yml
This workflow now grants
issues: write(wasissues: none) with the rationale thatmshick/add-pr-commentupdates PR comments via the Issues API. However,.github/workflows/merge-check.ymluses the samemshick/add-pr-comment@v3with onlypull-requests: writeand posts PR comments successfully. In GitHub's permission model, PR comments are accessible via eitherpull-requests: writeorissues: writesince they share the/issues/{n}/commentsendpoint, sopull-requests: writeshould normally be sufficient. The plausible difference here is the use ofmessage-id: conflict-predictionfor sticky comment updates, which may exercise a code path in v3 that the simple post-once usage inmerge-check.ymldoes not. If a concrete v3 failure was observed withoutissues: write, a one-line note linking to the failing run (or to a v2→v3 migration note) in the comment would harden the justification. Otherwise, droppingissues: writeto match the rest of the repo and the PR description's stated least-privilege intent would be cleaner. Not blocking — over-grantingissues: writeon a PR-only workflow is low-risk.source: ['claude']
🤖 Fix this with AI agents