Skip to content

fix(release): dry runs no longer require RELEASE_TOKEN - #183

Merged
stozo04 merged 2 commits into
mainfrom
fix/release-token-fallback
Sep 7, 2026
Merged

stozo04 merged 2 commits into
mainfrom
fix/release-token-fallback

Conversation

@stozo04

@stozo04 stozo04 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

The first dispatch failed at actions/checkout with Input required and not supplied: token. My bug: I passed token: ${{ secrets.RELEASE_TOKEN }} unconditionally, and with the secret unset that resolves to an empty string, which checkout rejects. It never reached a permissions question — a dry run only reads the repo and should never have needed a write credential.

  • Checkout and gh now fall back to the job's own GITHUB_TOKEN when RELEASE_TOKEN is absent
  • A real run still needs the PAT, so it's checked up front with an error that names the secret, instead of failing later mid-push
  • The signing secrets are checked the same way, before the build rather than during it

The PAT check lives in the step's shell rather than its if:secrets isn't an allowed context in a step condition, so the first version of this guard would not have evaluated as intended.

After this, dry_run works with no PAT at all.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Miqsf1M14nY5TKiZHzyjNY


Note

Low Risk
CI workflow-only changes that improve credential handling and early validation; no app runtime or signing logic changes.

Overview
Dry-run release builds can run without RELEASE_TOKEN: GH_TOKEN and checkout now use secrets.RELEASE_TOKEN || github.token, so a missing PAT no longer breaks actions/checkout with an empty token.

Real releases still require the PAT. A new upfront step (only when dry_run is false) fails fast with a clear error if RELEASE_TOKEN is missing, instead of failing mid-push/merge. The check runs in shell because secrets cannot be used in step if: conditions.

Signing secrets are validated the same way before the Gradle build: all five keystore/Firebase secrets must be set on every run, with named errors if any are missing.

Workflow header comments were updated to spell out which secrets apply to dry vs full release runs.

Reviewed by Cursor Bugbot for commit a669945. Bugbot is set up for automated code reviews on this repo. Configure here.

… is missing

A dry run only reads the repo, so requiring RELEASE_TOKEN for it was wrong —
an unset secret made actions/checkout fail with "Input required and not
supplied: token" before anything useful ran.

Checkout and gh now fall back to the job's own GITHUB_TOKEN. A real run still
needs the PAT to push and merge, so it is checked explicitly up front with a
message that names the secret, rather than failing later mid-push.
`secrets` is not an allowed context in a step-level `if:`, so the guard I
just added would not have evaluated as intended. Gate the step on dry_run
alone and test the secret in the shell, where it is a normal env var.
@stozo04
stozo04 merged commit 24ec869 into main Sep 7, 2026
3 checks passed
@stozo04
stozo04 deleted the fix/release-token-fallback branch September 7, 2026 20:50
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