ci(agricola-audit): open the state PR via github-sts - #194
Merged
Conversation
The org is disabling "Allow GitHub Actions to create and approve pull requests", after which the built-in GITHUB_TOKEN cannot open PRs. Mint a short-lived App token via github-sts (policy: agricola-audit-state) in the roll-up job and pass it to persist-agricola-state. contents: write stays for the state-branch pushes, which the org setting does not affect.
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.
Motivation
We are disabling the org-level "Allow GitHub Actions to create and approve pull requests" setting, after which the built-in
GITHUB_TOKENcan no longer open or approve pull requests. The audit roll-up job opens theagricola/statecheckpoint PR throughpersist-agricola-statewithgithub.token.Changes
tempoxyz/gh-actions/actions/github-sts, SHA-pinned) and pass it topersist-agricola-state(the composite action is unchanged).pull-requests: writewithid-token: write.contents: writestays:agricola state-transactionstill pushes the state branch with the checkout credentials, and branch pushes are unaffected by the org setting..github/sts/agricola-audit-state.sts.yaml: subject pinned to this repo'smainref with ajob_workflow_refclaim check on this workflow, grantingcontents: write+pull_requests: write.Notes
agricola.yml(same pattern, own policy) anddependabot.yml.