fix(workflow): hard-coded 'main' at reusable-release.yml:608 breaks non-main default branches #370
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#370
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?
Finding
External cold-read round 3 caught:
.forgejo/workflows/reusable-release.yml:608hard-codes"main"in the gamma manifest PR path. Elsewhere in the same file, base branch is derived carefully.Impact
Adopters whose default branch is not
main(master, trunk, develop, custom names) will silently hit this hard-coded value. The manifest PR will be created againstmainwhich either doesn't exist (fail loud) or exists with unrelated content (silent-corruption class).Scope (widened per operator ratify 2026-07-04)
Not just a hard-coded-value fix — implement proper layered default-branch resolution with config override support.
Resolution order (implement all layers with fallback)
Config override — adopter-explicit (top priority):
.release-toolkit.ymldefault_branch:fieldRT_DEFAULT_BRANCH(from repo variables or workflow env)Forgejo Actions native context:
${{ github.event.repository.default_branch }}in workflow YAMLForgejo API fallback:
GET /repos/{owner}/{repo}returns authoritativedefault_branchGit ref fallback:
git symbolic-ref refs/remotes/origin/HEADextracts ref nameFail loud if none resolve:
Two config override forms to support
vars.RT_DEFAULT_BRANCHin workflow YAML → env to script. More discoverable, shows in workflow_dispatch UI.default_branch:field. More version-controlled, change tracked in git.Both should work; adopters pick per their operational preference.
Grep sweep
Verification AC
default_branch:configAnchor
External cold-read round 3 (fresh ChatGPT session, 2026-07-04) verdict 'promising but not yet trustworthy'. Reviewer verified via execution. New findings surfaced despite round-2 delta closures. Operator ratified delta plan 2026-07-04. Scope widened per operator directive 2026-07-04 (design discussion in Bosun-operator exchange).
BLOCKING v1.0.0.
Delta merged via PR #378. Widened per operator ratify: layered 6-layer default-branch resolution (RT_DEFAULT_BRANCH env →
release-toolkit.ymldefault_branch:→TOOLKIT_DEFAULT_BRANCH_HINTworkflow context → Forgejo API → git-ref symref → fail-loud with actionable error). Adopters on non-maindefault branches (trunk/master/develop/custom) no longer hit the silent-corruption class at the manifest follow-up PR path. Includes Surveyor 9a16's must-fix env-var-on-correct-step wiring + config_get_default_branch delegation viadeclare -F(with mutation-verifiable shim test) + layer-4 docstring correction. Full docs indocs/integration.md § Default branch (#370).release-bot referenced this issue2026-07-05 20:36:42 +02:00