Skip to content

CI: grant pull-requests:read to pr-verifier caller#379

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
rh-dnagornuks:fix-pr-verifier-permissions
Jun 8, 2026
Merged

CI: grant pull-requests:read to pr-verifier caller#379
pdettori merged 1 commit into
rossoctl:mainfrom
rh-dnagornuks:fix-pr-verifier-permissions

Conversation

@rh-dnagornuks

@rh-dnagornuks rh-dnagornuks commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The permissions: {} block added in e5a5605 locked all token permissions
to none at the workflow level. GitHub enforces the caller's permissions
as a hard ceiling for any reusable workflow it invokes, so the nested
pr-title-check job in kagenti/.github/workflows/pr-verifier-required.yml
was 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

  • Replace permissions: {} with permissions: pull-requests: read in
    .github/workflows/pr-verifier.yml — the minimum scope required by the
    reusable workflow

Test Plan

  • The workflow runs successfully on a valid PR rh-dnagornuks/kagenti-operator/pull/1

Made with Cursor

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>
@rh-dnagornuks rh-dnagornuks changed the title CI: Grant pull-requests:read to pr-verifier caller CI: grant pull-requests:read to pr-verifier caller May 27, 2026
@rh-dnagornuks
rh-dnagornuks marked this pull request as ready for review May 27, 2026 12:06
@rh-dnagornuks
rh-dnagornuks requested a review from a team as a code owner May 27, 2026 12:06

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pdettori
pdettori merged commit e042ba3 into rossoctl:main Jun 8, 2026
20 of 21 checks passed
@github-project-automation github-project-automation Bot moved this from New /:ToDo to Done in Rossoctl Issue Prioritization Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants