Skip to content

ci: release workflow auto-creates publish branch#29

Merged
line0 merged 1 commit into
mainfrom
release-autocreate-publish-branch
Jul 24, 2026
Merged

ci: release workflow auto-creates publish branch#29
line0 merged 1 commit into
mainfrom
release-autocreate-publish-branch

Conversation

@line0

@line0 line0 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

The publish step assumed the publish branch already existed, running git fetch origin <publish-branch> and git worktree add … origin/<publish-branch> unconditionally. On a repo's first release that branch doesn't exist yet, so the run died with:

fatal: couldn't find remote ref publish

By then it had already pushed the release commit to the dev branch and created the version tags, leaving a half-finished release.

The step now checks whether the branch exists on the remote first. If it does, behavior is unchanged. If it doesn't, the worktree is seeded from the released commit and the step's existing git push origin HEAD:<publish-branch> creates the branch.

Seeding from HEAD rather than an empty orphan branch is deliberate: merge-feed --into _publish/DependencyControl.json exits non-zero when that file is missing, and the step's rsync excludes DependencyControl.json, so an orphan branch would fail one step later instead.

Why it matters beyond this repo

reusable-publish-release.yml is the building block third-party package repos call, so every one of them would hit this on their first release. The README's setup step told them to create the branch by hand, which is no longer necessary.

Testing

Not exercised by a real run. This surfaced while releasing DependencyControl 0.7.0, and that release was unblocked by creating the publish branch manually, so the new bootstrap path hasn't run in CI yet. It will first execute on the next package repo that releases without a publish branch.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Test results — macos-latest ✅1054 · ubuntu-latest ✅1054 · windows-latest ✅1051

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
3162 3159 0 3 0 0 1m 39s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@line0
line0 merged commit 2b4ec76 into main Jul 24, 2026
4 checks passed
@line0
line0 deleted the release-autocreate-publish-branch branch July 24, 2026 03:18
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