Skip to content

Remove unused pull-requests: read permission from apply.yml#16

Merged
gsavage merged 1 commit into
mainfrom
remove-unused-pr-read-permission
May 21, 2026
Merged

Remove unused pull-requests: read permission from apply.yml#16
gsavage merged 1 commit into
mainfrom
remove-unused-pr-read-permission

Conversation

@gsavage

@gsavage gsavage commented May 21, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@gsavage gsavage merged commit 7b36b1f into main May 21, 2026
1 check passed
@gsavage gsavage deleted the remove-unused-pr-read-permission branch May 21, 2026 10:29
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant