Repository navigation
skills(nightly): audit bot PAT scopes via script - #294
Merged
Merged
Conversation
Adds plugins/tend-ci-runner/scripts/pat-scope-audit.sh that parses the bot PAT's X-OAuth-Scopes header and reports missing required scopes (repo, workflow, notifications, write:discussion, gist). New Step 1 in the nightly skill runs the script and drives the tracking-issue open/update/close flow. Fine-grained PATs are reported as such and skipped (no documented self-introspection endpoint). Adds an "Agent-driven vs deterministic steps" section to CLAUDE.md capturing the split: agent drives inside the action, Actions gate whether it runs at all. Co-authored-by: Claude <[email protected]>
tend-agent
approved these changes
Apr 16, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 18, 2026
Bumps generator version to 0.0.16 and syncs lockfile. 7 commits since 0.0.15: nightly bot PAT scope audit (#294), review-reviewers gist-backed evidence storage with single-fetch optimization (#291, #292), nightly closes bot-opened tracking issues when resolved (#290), drops GITHUB_STEP_SUMMARY writes that fail under Claude sandbox (#289), release docs clarification (#288), and notifications dedup of bot-authored PRs (#279). Co-Authored-By: Claude <[email protected]>
Merged
max-sixty
added a commit
that referenced
this pull request
Apr 18, 2026
Bumps generator to 0.0.16. ## Changes since 0.0.15 - #294 — nightly: audit bot PAT scopes via script - #292 — review-reviewers: fetch current-month gist once per run - #291 — review-reviewers: pilot gist-backed evidence storage - #290 — nightly: close bot-opened tracking issues when resolved - #289 — skills: drop `GITHUB_STEP_SUMMARY` writes that fail under Claude sandbox - #288 — docs(release): commit on the current branch, don't create a new one - #279 — notifications: dedup bot-authored PRs cross-referencing the issue 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
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.
Catches the case where a required classic OAuth scope is added upstream (most recently
gistin #291) but adopter repos still have older PATs that will silently fail the first time an affected skill runs.New:
plugins/tend-ci-runner/scripts/pat-scope-audit.shparses the bot PAT'sX-OAuth-Scopesresponse header, compares granted vs required, and printsSTATUS=ok|missing|fine-grainedplus CSV lists on stdout. No GitHub writes — detection only.Wired into nightly: Step 1 of the
nightlyskill runs the script and acts onSTATUS— closes a prior tracking issue when scopes are now complete, opens/updates one (deduped via marker<!-- tend-pat-scope-audit -->) when scopes are missing, skips fine-grained PATs with a log line. Remediation in the issue body points at step 8 of theinstall-tendskill.CLAUDE.md: added a short section capturing the split we settled on while designing this — agent drives diagnostics/remediation inside the action; Actions gate whether the agent runs at all. The reason this landed as an agent-driven skill step rather than deterministic YAML.
Fine-grained PAT self-introspection is not supported by GitHub (no documented endpoint exposes a fine-grained token's permissions), so those are reported and skipped rather than probed. The three prose locations documenting required scopes (
docs/tend.example.toml,DESIGN.md,plugins/install-tend/skills/install-tend/SKILL.md) remain the reader-facing source; this script is the one executable reference — a comment in the script names them so future scope additions are easy to keep in sync.