Skip to content

ci(agricola-audit): open the state PR via github-sts - #194

Merged
sds merged 1 commit into
mainfrom
github-sts/agricola-audit-state
Aug 25, 2026
Merged

ci(agricola-audit): open the state PR via github-sts#194
sds merged 1 commit into
mainfrom
github-sts/agricola-audit-state

Conversation

@sds

@sds sds commented Aug 24, 2026

Copy link
Copy Markdown
Member

Motivation

We are disabling the org-level "Allow GitHub Actions to create and approve pull requests" setting, after which the built-in GITHUB_TOKEN can no longer open or approve pull requests. The audit roll-up job opens the agricola/state checkpoint PR through persist-agricola-state with github.token.

Changes

  • Mint a short-lived GitHub App token via STS(tempoxyz/gh-actions/actions/github-sts, SHA-pinned) and pass it to persist-agricola-state (the composite action is unchanged).
  • Replace the roll-up job's pull-requests: write with id-token: write. contents: write stays: agricola state-transaction still pushes the state branch with the checkout credentials, and branch pushes are unaffected by the org setting.
  • Add .github/sts/agricola-audit-state.sts.yaml: subject pinned to this repo's main ref with a job_workflow_ref claim check on this workflow, granting contents: write + pull_requests: write.

Notes

  • Sibling PRs migrate agricola.yml (same pattern, own policy) and dependabot.yml.
  • Verify by dispatching Agricola SDK audit after merge.

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.
@sds
sds merged commit b870c82 into main Aug 25, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant