Skip to content

docs(ci): warn that the Actions PR toggle also grants approvals - #758

Merged
goosewobbler merged 10 commits into
mainfrom
docs/653-actions-approval-tradeoff
Oct 24, 2026
Merged

goosewobbler merged 10 commits into
mainfrom
docs/653-actions-approval-tradeoff

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Documents the trade-off of Allow GitHub Actions to create and approve pull requests: the same toggle lets any workflow token approve PRs, and that approval counts toward a ≥ 1-approval ruleset.

  • ci-setup.md has a new "Workflow token approvals" section under "Securing the standing PR". It explains the risk, including the release:immediate path, and what to add to ruleset 2:
    • Require review from Code Owners, with a CODEOWNERS * rule naming an owner with write access, and no later pattern without one.
    • Dismiss stale pull request approvals when new commits are pushed.
    • It notes that each standing-PR update can dismiss the standing PR's approval, so approve it just before merging.
  • It says none of this applies to bypass actors, so a bypass given to the Actions bot is open to every workflow. The template's immediate-release job needs one on main, so remove it if you rely on the settings above (tracked in Standing-PR setup: bypasses for the Actions bot and workflow-wide id-token: write reach every workflow #785).
  • It recommends publishing from an environment restricted to the default branch, with registry tokens as environment secrets and the environment required by each trusted publisher. A merged PR's closed run has the branch it merged into as its ref, so the merge-triggered publish jobs pass. A label-triggered retry may not.
  • Ruleset 1's lock, docs/agents.md and docs/troubleshooting.md now say what an Actions-bot bypass opens up.
  • The setup requirement and ruleset 2 link to the section. So do the standing-PR template, examples/ci/standing-pr/standing-pr.yml and its README, the migration guide's setup step and docs/agents.md.

#653 also proposed a GitHub App token with the toggle off, which this PR leaves out on purpose. The App's key would be a repository secret, which any workflow on any branch can read, so a collaborator's workflow could mint an App token and approve their own PR. That's the same gap.

Fixes #653

Made with Cursor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous publishing-environment omission is fixed.

Summary

Documents the approval risk of GitHub Actions’ create-and-approve toggle.

  • Standing-release setup guidance now warns that the Actions toggle enables approvals.
  • Publishing guidance shows how both release jobs can use a restricted environment.

Reviews (4) · Last reviewed commit: "docs(ci): require the publish environmen..." · Reviewed by Greptile

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #730 · v0.42.1 queued (4 packages) · open 7h 37m · ✅ ready to merge

Release Preview — v0.42.0 → v0.42.1

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#730) when merged:

Changelog

monorepo 0.42.0 → 0.42.1

Changed

  • restore the default-branch environment advice (ci)
  • cover bypasses, stale approvals and CODEOWNERS gaps (ci)
  • say that publishOrder turns off the crate dependency sort (rust) (PR #787)
  • correct the workflow token approval guidance (ci)
  • say once where the publish environment goes (ci)
  • move the template's approval note below the guide link (ci)
  • cover retry-publish and refresh-after-release in the approval guidance (ci)
  • require the publish environment on immediate releases too (ci)
  • environment protection requires environment secrets (ci)
  • warn that the Actions PR toggle also grants approvals (ci)

Fixed

  • keep dependency order and branch-first push in per-package mode (publish) (PR #765)

All packages → 0.42.1 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.1 0.42.1 0.42.1

Updated automatically by ReleaseKit

Comment thread packages/release/docs/ci-setup.md Resolved
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

Co-authored-by: Cursor <cursoragent@cursor.com>
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

1 similar comment
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

Comment thread packages/release/docs/ci-setup.md Resolved
Co-authored-by: Cursor <cursoragent@cursor.com>
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

github-actions Bot and others added 5 commits October 23, 2026 22:37
…al guidance

The environment advice named publish-release and immediate-release, but the
ci-setup workflow and the example also publish from retry-publish. The App
token must also reach refresh-after-release, which can open the standing
PR. The section is shorter, the copied example workflow links to it by URL,
and the template comment no longer points at a path consumers don't have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note sat directly above the line #756 rewrites, so the two PRs
conflicted. It now has its own paragraph after the guide link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The publish-release comment already names immediate-release, so the
matching note on immediate-release repeated it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A branch-restricted environment rejects the publish jobs, since they run
on pull_request with the ref refs/pull/N/merge. A GitHub App whose key is
a repository secret can be minted by any workflow, so it doesn't close
the approval gap. Code Owners review only covers paths in CODEOWNERS, so
it needs a `*` rule.

The section now sits under "Securing the standing PR", and the template,
example and README link to it instead of restating it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot and others added 2 commits October 24, 2026 02:30
Code Owners review doesn't apply to bypass actors, and the release bot is
one. A stale code-owner approval still counts after new commits unless
it's dismissed, and a CODEOWNERS owner without write access is ignored.
Drops the environment-reviewers suggestion: those reviewers see the same
harmless-looking release, and a run waiting for approval holds the
workflow's concurrency group. Links the migration guide and agents.md to
the section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A merged PR's closed run has the branch it merged into as its ref, so an
environment restricted to the default branch accepts the publish jobs it
triggers. The earlier warning used the general pull_request ref, which
GitHub documents an exception to for merges. Label-triggered retries may
still be rejected.

Also says that the template's immediate-release job needs an Actions-bot
bypass on main, which voids Code Owners review for every workflow; that
each standing-PR update can dismiss the standing PR's approval; and
qualifies the release-branch lock, agents.md and troubleshooting.md to
match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@goosewobbler
goosewobbler merged commit b35dc13 into main Oct 24, 2026
34 checks passed
@goosewobbler
goosewobbler deleted the docs/653-actions-approval-tradeoff branch October 24, 2026 02:10
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.

docs(ci-setup): the required "Allow GitHub Actions to create and approve pull requests" setting weakens a ≥1-approval ruleset

1 participant