ci: limit changelog-preview secret access#1350
Merged
Merged
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Comment on lines
+19
to
+20
| secrets: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Bug: Explicitly passing GITHUB_TOKEN may cause the called workflow to lack the necessary pull-requests: write permission, as permissions are not propagated from the caller.
Severity: MEDIUM
Suggested Fix
Either revert to using secrets: inherit or ensure the called workflow (getsentry/craft/.github/workflows/changelog-preview.yml) defines its own permissions block with pull-requests: write and declares GITHUB_TOKEN in its on.workflow_call.secrets section.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: .github/workflows/changelog-preview.yml#L19-L20
Potential issue: The change from `secrets: inherit` to explicitly passing `GITHUB_TOKEN`
to a reusable workflow is likely to cause a permission error. The calling workflow has
`permissions: pull-requests: write`, but these permissions do not propagate to the
called workflow. The called workflow will use its own default permissions, which are
unlikely to include write access to pull requests. As a result, the `changelog-preview`
action will probably fail when it attempts to post a comment on a pull request due to
insufficient permissions.
Did we get this right? 👍 / 👎 to inform future reviews.
alexander-alderman-webb
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This just limits the scope of secrets passed to the changelog-preview action to only the required
GITHUB_TOKEN.Issues
Changelog Entry Instructions
To add a custom changelog entry, uncomment the section above. Supports:
For more details: custom changelog entries
Reminders
feat:,fix:,ref:,meta:)