fix: keep PR provenance checks least privilege - #10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c35118be40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
Skip attestations for read-only manual PR validation
When pr-validation.yml is started through its retained workflow_dispatch trigger, the reusable workflow still executes Generate OCI artifact attestations because its condition accepts every workflow_dispatch event (quality-gates.yml:764-766). This caller now grants only contents: read, so the attestation action cannot obtain the required identity-token and attestation permissions and the manual validation fails. Either exclude the pull-request context from that condition or route manual runs through a write-capable caller.
Useful? React with 👍 / 👎.
Summary\n- inherit provenance permissions from each caller instead of elevating them in the reusable workflow\n- keep pull-request validation read-only while push/manual callers retain attestation permissions\n- make the static permission assertions check commit-tests.yml, the effective write-capable caller\n\n## Verification\n- npm test\n- git diff --check\n- static workflow permission assertions\n\nThis corrects the startup failure observed in run 32871809589 without granting write permissions to pull-request code.