Repository navigation
AST-171789 Use GITHUB_TOKEN instead of PAT in pr-automation workflow - #726
Closed
cx-lior-poterman wants to merge 1 commit into
Closed
cx-lior-poterman wants to merge 1 commit into
cx-lior-poterman wants to merge 1 commit into
Conversation
pr-automation.yml runs on pull_request_target, which executes with base-repo secrets and is reachable by any external contributor opening a PR against this public repo, without the fork-approval gate that guards plain pull_request runs. The job only calls `gh pr edit --add-reviewer`, already covered by the workflow's `pull-requests: write` permission, so the long-lived org PAT it was using is unnecessary exposure. Swap it for the ephemeral GITHUB_TOKEN, which also makes the workflow's `contents: none` ceiling actually binding since a PAT carries its own scopes regardless of the permissions block. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Original alert (resolved)Security Policy Alert: Secret Policy ViolationThis workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch. Secret references detected:
To approve this workflow, please add the Note: The label must be added by someone other than the PR author (cx-lior-poterman) or automation bots to ensure proper security review. After the label is added, you can re-run the blocked workflow to proceed. This workflow will be automatically approved once merged into the default branch. For more information, see StepSecurity's Secret Exfiltration Policy documentation. |
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.
pr-automation.yml runs on pull_request_target, which any external contributor can trigger by opening a PR against this public repo, bypassing the fork-approval gate and running with base-repo secrets. The job only needs
gh pr edit --add-reviewer, already covered by the existingpull-requests: writepermission, so it did not need the long-lived org PAT it was using. Swapping to the ephemeral GITHUB_TOKEN cuts that exposure and also makes the workflow'scontents: noneceiling actually binding, since a PAT carries its own scopes regardless of the permissions block.