Skip to content

Authenticate the "latest" lookup - #5

Merged
nicodes merged 1 commit into
mainfrom
feat/forward-github-token
Aug 1, 2026
Merged

Authenticate the "latest" lookup#5
nicodes merged 1 commit into
mainfrom
feat/forward-github-token

Conversation

@nicodes

@nicodes nicodes commented Aug 1, 2026

Copy link
Copy Markdown
Member

The other half of aviorstudio/gdam#4, now merged.

That PR taught the install script to use a token. GITHUB_TOKEN is not in the environment by default in Actions, so it has to be handed over — this does that.

The default is the point

token:
  default: ${{ github.token }}

Consumers get authentication from the version bump alone and change nothing. The alternative — requiring each of the 16 repositories to pass a token — turns 16 one-line PRs into 16 two-place PRs for no benefit.

The pattern is already proven in these orgs: gdam-be and castledrop both use ${{ github.token }} inside composite actions, and prizm threads a github-token input the same way.

Why

The unauthenticated GitHub API allows 60 requests an hour per IP address, and runners share addresses. macOS runners share them heavily enough that resolving latest returned 403 several times an hour:

curl: (56) The requested URL returned error: 403
failed to resolve latest release for aviorstudio/gdam

That failed installs intermittently across all 16 consumers, and blocked this repo's own release three times in a row.

Authenticated, the limit is scoped to the token: 1,000/hour per repository, against exactly one lookup per workflow run.

One detail

It's passed as GDAM_GITHUB_TOKEN, not GITHUB_TOKEN. The script checks GDAM_GITHUB_TOKENGITHUB_TOKENGH_TOKEN, so using the specific name means the script gets exactly what the caller chose for this action, rather than quietly inheriting whatever the surrounding job happened to have set.

Verification

CI is the test: the install (macos-latest) job is the one that has been failing on this, and it exercises version: latest on the first step. If it passes here it passes for the reason this PR exists — though a single green run isn't proof against an intermittent fault, so I'll watch the release run that follows.

The install script can now use a token for the API call that resolves
"latest" (aviorstudio/gdam#4). It is not in the environment by default in
Actions, so it has to be handed over -- this does that, defaulting to the
workflow's own token so no consumer has to change anything.

The unauthenticated API allows 60 requests an hour PER IP ADDRESS, and
runners share addresses. macOS runners share them heavily enough that the
lookup returned 403 several times an hour, which failed installs
intermittently across all sixteen repositories using this action and
blocked this repo's own release three times. Authenticated, the limit is
scoped to the token: 1000/hour per repository, against one lookup per run.

Passed as GDAM_GITHUB_TOKEN rather than GITHUB_TOKEN so the script gets
exactly what the caller chose, instead of quietly inheriting whatever the
job happened to have in GITHUB_TOKEN.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nicodes
nicodes merged commit 97efb49 into main Aug 1, 2026
3 checks passed
@nicodes
nicodes deleted the feat/forward-github-token branch August 1, 2026 08:44
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