Remove unused pull-requests: read permission from apply.yml#16
Merged
Conversation
The reset-drift-detection job declared pull-requests: read on its GITHUB_TOKEN, but nothing in the job uses GITHUB_TOKEN to access pull requests. The kosli attest pr github step uses the separately-passed kosli_github_token secret via --github-token, not the workflow's default token. Drop the permission so the job requests only what it actually needs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 task
gsavage
added a commit
that referenced
this pull request
May 21, 2026
) ## Summary - Reverts the removal in #16 / a040666. - The previous commit assumed that passing the token explicitly via `--github-token "$GH_TOKEN"` made the job's `permissions:` block irrelevant. That was wrong: the `kosli_github_token` secret is the caller's workflow `GITHUB_TOKEN`, and its capabilities are governed by the **called job's** `permissions:` block. Caller `permissions:` only act as an upper bound on reusable workflows — they do not propagate into them. - Without `pull-requests: read`, the `kosli attest pr github` step fails with `Resource not accessible by integration` (the canonical signature of a GitHub-App-backed token lacking a permission). ## Test plan - [ ] Trigger an apply run from a caller repo that passes `kosli_github_token` and confirm `kosli attest pr github` no longer fails with "Resource not accessible by integration". 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reset-drift-detection job declared pull-requests: read on its GITHUB_TOKEN, but nothing in the job uses GITHUB_TOKEN to access pull requests. The kosli attest pr github step uses the separately-passed kosli_github_token secret via --github-token, not the workflow's default token. Drop the permission so the job requests only what it actually needs.