Restore pull-requests: read permission in reset-drift-detection job#18
Merged
Conversation
The previous commit (a040666) removed this permission on the assumption that because `kosli attest pr github` is passed the token explicitly via `--github-token "$GH_TOKEN"`, the job's permissions block was irrelevant. That reasoning was wrong. The kosli_github_token secret is the caller's workflow GITHUB_TOKEN. Its capabilities are governed by the called job's permissions block, not the caller's — caller permissions only act as an upper bound on reusable workflows and do not propagate into them. Without pull-requests: read, the attestation step fails with: Resource not accessible by integration Restore the permission so the step can read PR metadata. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
gsavage
added a commit
that referenced
this pull request
May 26, 2026
## Summary - Add `kosli_github_token` to the Secrets table in the README — previously it was only documented in the workflow file itself. - Update the example caller workflow to show passing the token and granting the `pull-requests: read` permission, so anyone copy-pasting it doesn't later hit `Resource not accessible by integration` when wiring up the PR attestation step. - Add a short note explaining that both the caller job and the called job must grant `pull-requests: read`, since GitHub computes the token's permissions in a reusable workflow as the intersection of the two. Companion to #18 (which restores the permission on the called side). ## Test plan - [ ] Render the README on GitHub and confirm the table and example look right. - [ ] Copy the example caller workflow into a fresh repo and confirm `kosli attest pr github` succeeds. 🤖 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.
Summary
--github-token "$GH_TOKEN"made the job'spermissions:block irrelevant. That was wrong: thekosli_github_tokensecret is the caller's workflowGITHUB_TOKEN, and its capabilities are governed by the called job'spermissions:block. Callerpermissions:only act as an upper bound on reusable workflows — they do not propagate into them.pull-requests: read, thekosli attest pr githubstep fails withResource not accessible by integration(the canonical signature of a GitHub-App-backed token lacking a permission).Test plan
kosli_github_tokenand confirmkosli attest pr githubno longer fails with "Resource not accessible by integration".🤖 Generated with Claude Code