ci: fix bump-version workflow (GITHUB_TOKEN, push to main) - #32
Merged
Conversation
The bump-version workflow failed at checkout with "Input required and not supplied: token" because it referenced secrets.PAT, which is not configured in this repo (inherited from the upstream better-sqlite3 fork). It also pushed to `master`, but this repo's default branch is `main`. - Drop the PAT: use the built-in GITHUB_TOKEN with `contents: write`. - Push the version commit to `main` (was `master`). Pushes made with GITHUB_TOKEN don't trigger downstream workflows, so the npm release is still created manually — which fires the `release` event the publish job (npm publish --provenance) listens for. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The
bump-versionworkflow failed at checkout with:Two bugs inherited from the upstream
better-sqlite3fork:actions/checkoutusedtoken: ${{ secrets.PAT }}, but noPATsecret is configured in this repo (the repo has no secrets at all since the switch to OIDC trusted publishing). The empty token made checkout fail.master:master, but this repo's default branch ismain.Fix
GITHUB_TOKENwithpermissions: contents: write.main(wasmaster).Release flow note
Pushes made with
GITHUB_TOKENintentionally do not trigger downstream workflows, so this job only bumps the version + pushes the tag. To publish to npm (with provenance), create a GitHub Release from the new tag — that fires thereleaseevent thepublishjob listens for (npm publish --provenance).If you'd prefer the bump to auto-create the release and trigger publish end-to-end, that needs a PAT or GitHub App token (GITHUB_TOKEN can't cascade) — happy to wire that up as a follow-up.
Note
If
mainis a protected branch requiring PRs, the direct push from this job will be rejected; that's a repo-settings consideration, not a workflow one.🤖 Generated with Claude Code