CI: grant pull-requests:read to pr-verifier caller#379
Conversation
The top-level `permissions: {}` introduced in e5a5605 locked all
permissions to none, blocking the nested `pr-title-check` job in
the reusable workflow from requesting `pull-requests: read`.
Signed-off-by: Daniels Nagornuks <dnagornu@redhat.com>
cwiklik
left a comment
There was a problem hiding this comment.
Correct, minimal CI permissions fix: replaces permissions: {} (which starved the reusable pr-verifier-required.yml of the token scope it needs to read the PR) with the least-privilege pull-requests: read. Safe by construction — the pull_request trigger yields a read-only token even for fork PRs, and the value granted is read-only. The required verify-pr-title check now passes.
Security: least-privilege read-only grant; pull_request (not pull_request_target); reusable workflow pinned to a SHA — all good.
Commits: signed-off. Nit: subject Ci: should be lowercase ci: (conventional commits); the repo's own title check accepts it, so non-blocking.
All 17 CI checks passing.
|
|
||
| permissions: {} | ||
| permissions: | ||
| pull-requests: read |
There was a problem hiding this comment.
nit (optional, least-privilege hygiene): consider scoping this to the verify-pr-title job (jobs.verify-pr-title.permissions.pull-requests: read) rather than top-level. Equivalent today with a single reusable-workflow job, but job-level scoping keeps the grant from silently extending to any future job added to this workflow. The pull-requests: read value itself is exactly right.
Summary
The
permissions: {}block added in e5a5605 locked all token permissionsto
noneat the workflow level. GitHub enforces the caller's permissionsas a hard ceiling for any reusable workflow it invokes, so the nested
pr-title-checkjob inkagenti/.github/workflows/pr-verifier-required.ymlwas blocked from requesting
pull-requests: read— causing the workflow to fail.The workflow after that commit has failed to run on every PR made since:
https://github.com/kagenti/kagenti-operator/actions/workflows/pr-verifier.yml
Changes
permissions: {}withpermissions: pull-requests: readin.github/workflows/pr-verifier.yml— the minimum scope required by thereusable workflow
Test Plan
Made with Cursor