fix(ci): push release commits with a service account token #41

Closed
claude-bot wants to merge 1 commit from fix/40-publish-push-protected-branch into develop
Member

Closes #40

Change

  • .forgejo/workflows/ci.yaml, job publish: the checkout uses the repository secret RELEASE_BOT_TOKEN, so the push of the version bumps and of the release tags is made by a service account instead of the automatic workflow token. A first step stops the job, before anything is published, when the secret is missing.
  • guidelines/CONTRIBUTING_AGENTS.md: the secret is documented.

Why

On a protected branch the forge answers the push of the automatic token with an internal error (user does not exist [uid: -2] in the pre-receive hook, Forgejo 15.0.11). Packages were published to npm and their versions never recorded.

Before merging

Until RELEASE_BOT_TOKEN exists, the publish job fails at its first step and publishes nothing. Set up first:

  1. a service account with write access to this repository;
  2. its name in the push allowlist of the protection rules of develop and main;
  3. an access token of that account with the scope write:repository, stored as the repository secret RELEASE_BOT_TOKEN.

Verified

The workflow file parses. The publish job only runs on pushes to develop and main, so the CI of this pull request does not exercise the change: the first push to develop after the merge does.

To know

A push made with a personal token starts workflows, unlike the automatic token. The bump commit carries [skip ci], which the forge honours.

🤖 Generated with Claude Code

Closes #40 ## Change - `.forgejo/workflows/ci.yaml`, job `publish`: the checkout uses the repository secret `RELEASE_BOT_TOKEN`, so the push of the version bumps and of the release tags is made by a service account instead of the automatic workflow token. A first step stops the job, before anything is published, when the secret is missing. - `guidelines/CONTRIBUTING_AGENTS.md`: the secret is documented. ## Why On a protected branch the forge answers the push of the automatic token with an internal error (`user does not exist [uid: -2]` in the pre-receive hook, Forgejo 15.0.11). Packages were published to npm and their versions never recorded. ## Before merging Until `RELEASE_BOT_TOKEN` exists, the `publish` job fails at its first step and publishes nothing. Set up first: 1. a service account with write access to this repository; 2. its name in the push allowlist of the protection rules of `develop` and `main`; 3. an access token of that account with the scope `write:repository`, stored as the repository secret `RELEASE_BOT_TOKEN`. ## Verified The workflow file parses. The `publish` job only runs on pushes to `develop` and `main`, so the CI of this pull request does not exercise the change: the first push to `develop` after the merge does. ## To know A push made with a personal token starts workflows, unlike the automatic token. The bump commit carries `[skip ci]`, which the forge honours. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ci): push release commits with a service account token (#40)
All checks were successful
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 3m39s
Quatrain Core Sovereign CI / Publish Changed Packages to npm (pull_request) Has been skipped
afe0f631e5
The automatic workflow token cannot push to a protected branch: the pre-receive hook of
the forge fails to resolve its internal account and answers with an internal error. The
publish job therefore published to npm without recording the versions.

The job now checks out with the token of a service account allowed by the branch
protection, and stops before publishing when the secret is missing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Member

Closed without merging: the maintainer changed the branch rights instead, so the publish job keeps the automatic token. Merging this would make the job fail on the missing secret RELEASE_BOT_TOKEN.

Closed without merging: the maintainer changed the branch rights instead, so the publish job keeps the automatic token. Merging this would make the job fail on the missing secret `RELEASE_BOT_TOKEN`.
claude-bot closed this pull request 2026-11-14 14:31:05 +00:00
All checks were successful
Quatrain Core Sovereign CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 3m39s
Quatrain Core Sovereign CI / Publish Changed Packages to npm (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No description provided.