Skip to content

Drop pull-requests: write from the CI approval gate - #340

Open
mcocdawc wants to merge 1 commit into
mainfrom
ci-approval-permissions
Open

mcocdawc wants to merge 1 commit into
mainfrom
ci-approval-permissions

Conversation

@mcocdawc

@mcocdawc mcocdawc commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The ci-approval job got pull-requests: write when require-ci-approval deleted the approved-for-ci label on every fork push. That label scheme is gone: a maintainer's re-run approves, and the action only reads the event and looks up the permission of whoever started the run, so the write grant was a leftover. In ci.yml the gate now inherits the workflow's contents: read (enough for check-workflows), the downstream workflows give it contents: read explicitly since they set no workflow-level permissions, and ci-fork.yml grants pull-requests: read instead of write (the hpc-gate job still reads the pull request). The bot's regeneration PRs will carry the change to the rolled-out repos.

The collaborator-permission lookup is only reached for a fork pull request, so the first fork PR after the merge is what proves it under the reduced token.

🤖 Generated with Claude Code

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Documentation preview
https://sites.ecmwf.int/docs/dev-section/ci-infrastructure/pull-requests/PR-340

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mcocdawc
mcocdawc requested a review from iainrussell as a code owner December 4, 2026 15:59
@mcocdawc mcocdawc added the test-dependent-images-not-needed PR CI builds only the base images it changes label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-dependent-images-not-needed PR CI builds only the base images it changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant