Repository navigation
fix(scripts): stop reading github_token, use gh only - #3
Merged
Merged
Conversation
DmitriyG1
marked this pull request as draft
November 17, 2026 17:44
DmitriyG1
commented
Nov 17, 2026
DmitriyG1
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review of the three commits against main (/code-review medium). The fix does what it says: releases.py no longer reads GITHUB_TOKEN, and the new test fails without it.
Severity:
🔴 a required check can pass while the thing it checks is broken; fix before merging
🟠 wrong behavior in a narrower case; fix in this PR
🟢 minor or already decided/tracked; no change needed now
🔴: none.
Two findings are on files this PR does not touch, so they are here instead of inline:
- 🟢
skills/android-upstream-audit/scripts/common.py:36: thecurl()docstring still says "Headers go through stdin, so a token never shows in the process list", but no caller sends a token any more. Stale; a reader could take it as an invitation to add anAuthorizationheader back. Cheap to reword in this PR. - 🟢
skills/android-upstream-audit/scripts/common.py:37: the User-Agent is hard-coded asandroid-upstream-audit/1.0, so 1.1.0 identifies itself as 1.0.common.skill_version()already exists. Unrelated to the token; separate fix.
DmitriyG1
force-pushed
the
fix/no-github-token
branch
4 times, most recently
from
November 17, 2026 18:21
8665819 to
5c34017
Compare
Without gh, releases.py asked GitHub through curl and sent GITHUB_TOKEN from the environment as an Authorization header. The skill must not read credentials (AGENTS.md, Security rules). gh is now the only authenticated way to GitHub; without it curl runs unauthenticated (60 requests an hour) and the client status line says so. gh reads GH_TOKEN / GITHUB_TOKEN itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github_client() chose gh whenever it was on PATH. A gh that is not logged in fails every `gh api` call, so the run got no GitHub data at all, while unauthenticated curl still has 60 requests an hour. Check `gh auth status --hostname github.com` (its exit code only; the output names the account and a masked token) and fall back to curl, saying why on the client status line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill no longer reads GITHUB_TOKEN. Say that gh, installed and authenticated, gives authenticated requests, and that without it the audit asks GitHub unauthenticated (60 requests an hour) and the report says so. Drop the note about a future version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DmitriyG1
force-pushed
the
fix/no-github-token
branch
from
November 17, 2026 18:26
5c34017 to
e00c73a
Compare
DmitriyG1
marked this pull request as ready for review
November 17, 2026 19:24
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.
What
releases.py: on the curl path (nogh),github()no longer readsGITHUB_TOKENor sends anAuthorizationheader. The client status line says the requests are unauthenticated (60 an hour) and how to get more. The docstring is updated to match.Authorizationheader is sent, even withGITHUB_TOKENset.github_client():ghis used only whengh auth status --hostname github.comsucceeds (exit code only; its output is discarded). Aghthat is installed but not logged in failed every call; now the run falls back to unauthenticated curl and the status line says why. Tests for each case.unauthenticated (60 requests an hour) — install and authenticate gh.README.md:ghinstalled and authenticated → authenticated requests; nogh→ unauthenticated, 60 an hour, and the report says so.ghreadsGH_TOKEN/GITHUB_TOKENitself; the skill never does.plugin.jsonversion andCHANGELOG.md. No format change, no--initneeded.Why
The skill read a credential from the user's environment, against AGENTS.md Security rules ("read, collect, print or send credentials, tokens…"). It is also a point the Claude plugin directory holds for review, and something every user has to decide to trust.
ghalready honoursGH_TOKEN/GITHUB_TOKEN, and GitHub Actions runners ship it, so nothing real is lost.Testing
python3 -m unittest discover skills/android-upstream-audit/scripts/tests: 89 tests, OK on every commit (Gradle test skipped locally; the init script did not change, CI runs it). Both new tests failed before their fix.claude plugin validate . --profile directory: passed.Real
gh: logged in →gh; with an emptyGH_CONFIG_DIRand no token →curl, "gh is installed but not logged in".Smoke test: with
ghhidden fromPATHandGITHUB_TOKEN=x,github_client()returnscurland a real request toapi.github.comsucceeds unauthenticated. Before the fix, the bogus token would have caused a 401.Control run on nowinandroid (
/android-upstream-auditwithclaude --plugin-diron this branch): report headerSkill: 1.1.0;releases.py128 calls throughgh, 0 failed; 26 pages, 0 failed; no GitHub note in the upkeep line.releases.py --outon nowinandroid in the three client cases:releases.pygithub_clientghinstalled and logged inGitHub API client: ghghghinstalled, not logged in (emptyGH_CONFIG_DIR, no token)curl — gh is installed but not logged in; unauthenticated, 60 requests an hour; run gh auth login for morecurlghonPATH,GITHUB_TOKEN=boguscurl — gh is not installed; unauthenticated, 60 requests an hour; install gh and run gh auth login for morecurlNo 401 with a bogus
GITHUB_TOKEN: the token is not sent. The two unauthenticated runs used 18 of GitHub's 60 requests an hour (about 9 a run; the rest of the 128 calls go to deps.dev and Maven repositories), so 60 is enough for a project of this size.Agent: Claude Code (Claude Opus 5.5).
A CI check that forbids
GITHUB_TOKENinskills/is left for the planned skill-specific checks.🤖 Generated with Claude Code