Skip to content

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

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

ci(agricola): open the state PR via github-sts#193
sds merged 1 commit into
mainfrom
github-sts/agricola-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 run and record jobs open 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) in both jobs and pass it to persist-agricola-state (the composite action is unchanged — it already takes the token as an input).
  • Replace pull-requests: write with id-token: write at the workflow level. 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-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-audit.yml (same pattern, own policy) and dependabot.yml.
  • Verify by dispatching Agricola control plane 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-state) in the run and
record jobs 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 9997443 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