Skip to content

Commit 0efb44a

Browse files
committed
chore: simplify release finalize to rename branch atomically
Replace two-step create+delete with a single git push refspec that renames release/candidate to release/v{version} atomically.
1 parent 3b65b79 commit 0efb44a

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

.github/workflows/release-finalize.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Triggers when release-please PR is merged to release/candidate.
2-
# Creates the final release/v{version} branch and deletes the candidate branch.
2+
# Renames release/candidate to release/v{version}.
33
name: "Release: Finalize"
44

55
on:
@@ -42,18 +42,12 @@ jobs:
4242
echo "version=$VERSION" >> $GITHUB_OUTPUT
4343
echo "Extracted version: $VERSION"
4444
45-
- name: Create release branch
45+
- name: Rename release/candidate to release/v{version}
4646
if: steps.check.outputs.is_release_pr == 'true'
4747
run: |
48-
git checkout -b "release/v${{ steps.version.outputs.version }}"
49-
git push origin "release/v${{ steps.version.outputs.version }}"
50-
echo "Created branch: release/v${{ steps.version.outputs.version }}"
51-
52-
- name: Delete release/candidate branch
53-
if: steps.check.outputs.is_release_pr == 'true'
54-
run: |
55-
git push origin --delete release/candidate
56-
echo "Deleted branch: release/candidate"
48+
VERSION="v${{ steps.version.outputs.version }}"
49+
git push origin "release/candidate:refs/heads/release/$VERSION" ":release/candidate"
50+
echo "Renamed release/candidate to release/$VERSION"
5751
5852
- name: Update PR label to tagged
5953
if: steps.check.outputs.is_release_pr == 'true'

0 commit comments

Comments
 (0)