Skip to content

Name the credential when the release dispatch cannot authenticate - #11

Open
DGaffney wants to merge 1 commit into
mainfrom
fix/dispatch-credential-preflight
Open

DGaffney wants to merge 1 commit into
mainfrom
fix/dispatch-credential-preflight

Conversation

@DGaffney

@DGaffney DGaffney commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Part of an org-wide sweep of DISPATCH_GH_TOKEN usage; see graze-social/network#69 for the full write-up.

What's wrong here

This workflow dispatches to graze-social/turbo-deploy on every merge to main, using DISPATCH_GH_TOKEN. That token expired around 2026-04 — network, algo-cluster, algo-smasher and turbostream-sqs all fail on every merge with 401 Bad credentials.

This repo's failure mode is worse than a red X, and different from theirs. The step order is:

  1. create_tag — computes the next version
  2. create_release — gh release create (uses ${{ github.token }}, so it works)
  3. repo_dispatch — needs DISPATCH_GH_TOKEN, so it fails

So a dead token leaves you with a real git tag and a real GitHub release that nothing downstream ever built. The release looks published; turbo-deploy never heard about it.

The fix

Preflight the credential before dispatching, so an expired secret is reported by name with a pointer to the runbook, rather than surfacing as a bare 401 Bad credentials from inside the dispatch action.

Unlike the algo-cluster-bound build workflows, there's no deploy-target: label here — every merge is meant to dispatch — so there's no "nothing to deploy" case to distinguish, and the check is unconditional.

create_release already correctly uses the built-in token, so nothing else here needed changing. (Its counterpart in aip did not — see graze-social/aip#63.)

Note on token scope

This repo dispatches to turbo-deploy, not algo-cluster, and turbo-deploy also checks this repo out cross-repo. So DISPATCH_GH_TOKEN cannot be scoped to algo-cluster alone. The full scope table is in the runbook.

Verification

Extracted the preflight step body from the YAML and ran all three branches against the live GitHub API — empty token, a bogus token returning a real 401, and a valid token returning 200 — confirming the intended message and exit code (1/1/0) each time. Workflow YAML parses.

Only triggers on pull_request: closed, so it does not run on this PR.

🤖 Generated with Claude Code

This workflow dispatches to graze-social/turbo-deploy on every merge, using
DISPATCH_GH_TOKEN. That token expired around 2026-04, and a dead credential
here surfaces as a bare "401 Bad credentials" from the dispatch action --
after the git tag and GitHub release have already been created, so the
release exists but nothing downstream ever ran.

Preflight the token before dispatching, so an expired secret is reported by
name with a pointer to the rotation runbook.

Unlike the algo-cluster-bound build workflows, there is no deploy-target
label here: every merge is meant to dispatch, so the check is unconditional.

Runbook:
https://github.com/graze-social/network/blob/main/.github/DEPLOY_DISPATCH.md

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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