The publish job cannot push version bumps to a protected branch #40
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core#40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed
Since
developis protected, thepublishjob publishes the changed packages to npm and then fails ongit push origin HEAD:develop(runs 32 and 47):The forge logs at the same second:
-2is the internal account of the automatic workflow token. The pre-receive hook of a protected branch loads the pushing account to check its rights and fails on this one (Forgejo 15.0.11).Consequence
Versions published to npm are not recorded in the repository. On
main, the release tags would not be created either, since they come after this push.Expected
The job pushes with the token of a service account that the branch protection allows to push, and stops before publishing when that token is missing.
The maintainer changed the branch rights rather than adding a service account (pull request 41 closed). To close once a push to
developgets through thepublishjob, including the commitchore: release versions & update hashes.Catch-up expected on that run:
@quatrain/backend-postgres@1.2.14-beta.0and@quatrain/identifiers@1.0.0-beta.1are already on npm; the script computes the same versions again, skips their publication and records them.Status on 2026-11-15.
Cause: a Forgejo defect. On any protected branch, the pre-receive hook looks up the pushing user in the database (
routers/private/hook_pre_receive.go, step 5). The automatic Actions token belongs to the built-in user-2, which has no row, so the hook answers 500. No branch protection setting avoids it; changing the branch rights did not help (run 71 failed the same way).Reported upstream: https://codeberg.org/forgejo/forgejo/issues/15275 (an earlier report, forgejo/forgejo#11159, was closed by its author after a workaround, without a fix).
Decision: no workaround here (no service account, no deploy key, branch protection kept) while upstream answers. Until then the publish job publishes to npm, then fails on the push, and version bumps do not reach
develop. #47 makes each run publish the current code under the next free beta.This issue stays open until a push to
developpasses the publish job.Update, 2026-11-15: the branch protection rules were removed by the maintainer as a temporary measure. Run 76 on
developthen published and pushed the version bump (3d9b1fe).Allowing pushes to everyone with write access was tried first and did not help: any protection rule triggers the failing lookup (run 74).
This issue stays open as the reminder to restore the branch protection once https://codeberg.org/forgejo/forgejo/issues/15275 is fixed in the deployed Forgejo version.