Skip to content

chore: release with the built-in GitHub token - #362

Merged
Kudo merged 2 commits into
mainfrom
@kudo/release-github-token
Oct 20, 2026
Merged

Kudo merged 2 commits into
mainfrom
@kudo/release-github-token

Conversation

@Kudo

@Kudo Kudo commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

The release workflow fails with EGITNOPERMISSION. The EXPOBOT_GITHUB_TOKEN secret belongs to expo-bot, which now has only read access to this repo. GitHub returns Permission to expo/expo-github-action.git denied to expo-bot, and creating labels fails with 403 too.

How

Use the built-in github.token in the publish and tags jobs instead of the bot token. Each job asks only for what it needs. contents: write pushes the release commit and tags. issues: write and pull-requests: write cover the labels and "released in" comments from @semantic-release/github.

The rules on main only block deletion and force pushes, so a normal push of the release commit works.

The tradeoff is that pushes made with github.token don't start other workflows. review and test won't run on the chore: create new release commit. That commit only changes package.json, CHANGELOG.md and build/.

Some small hardening for the jobs that hold a write token:

  • publish checks out with persist-credentials: false, so the token isn't saved in .git/config where installed packages could read it. semantic-release adds the token to the push URL itself.
  • tags pushes only v<major>. git push --force --tags would overwrite any remote tag that differs from the local one.
  • tags reads the major version with node -p instead of bun add --dev semver and actions/github-script. The job no longer runs the runner setup or installs packages from npm at release time.

Test Plan

  • The last dryrun job on main already uses github.token. Its log shows Contents: write, Issues: write and PullRequests: write, and semantic-release logged Allowed to push to the Git repository.
  • Ran semantic-release --dry-run in a fresh clone with no saved git credentials, only GITHUB_TOKEN. It logged Allowed to push to the Git repository and next version 9.0.1.
  • Ran a dry-run force push of v9 alone. It touched only v9.
  • After merge, run the release workflow with release and check that 9.0.1 is published and v9 moves to it.

🤖 Generated with Claude Code

Kudo added 2 commits October 21, 2026 01:05
The expo-bot token lost write access to this repo, so releases fail
with EGITNOPERMISSION. The built-in token already has the access the
release needs.
Keep the token out of .git/config in publish, push only the major tag,
and stop installing packages from npm in the tags job.
@Kudo
Kudo marked this pull request as ready for review October 20, 2026 17:13
@Kudo
Kudo merged commit c33d336 into main Oct 20, 2026
14 checks passed
@Kudo
Kudo deleted the @kudo/release-github-token branch October 20, 2026 17:23
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