Skip to content

Commit 3d7d408

Browse files
author
strausr
committed
fix(release): add semantic-release note to existing v1.0.0-beta.1 tag
Tag was created outside semantic-release and has no git note, so semantic-release ignored it and tried to re-release 1.0.0-beta.1, causing 'tag already exists'. Add note {"channels":["beta"]} when missing so it is treated as last release and next version is 1.0.0-beta.2.
1 parent dcfea11 commit 3d7d408

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ jobs:
8585
git config user.name "github-actions[bot]"
8686
git config user.email "github-actions[bot]@users.noreply.github.com"
8787
88+
- name: Add semantic-release note to v1.0.0-beta.1 if missing
89+
run: |
90+
# Existing v1.0.0-beta.1 tag has no git note, so semantic-release ignores it and tries to re-release it.
91+
# Add the note so it is treated as last release and the next version is 1.0.0-beta.2.
92+
if git rev-parse --verify v1.0.0-beta.1 >/dev/null 2>&1; then
93+
if ! git notes --ref semantic-release-v1.0.0-beta.1 show v1.0.0-beta.1 >/dev/null 2>&1; then
94+
git notes --ref semantic-release-v1.0.0-beta.1 add -f -m '{"channels":["beta"]}' v1.0.0-beta.1
95+
if [ "${{ github.event.inputs.dry_run }}" != "true" ]; then
96+
git push origin refs/notes/semantic-release-v1.0.0-beta.1
97+
fi
98+
fi
99+
fi
100+
88101
- name: Create initial tag if needed
89102
if: github.event.inputs.dry_run != 'true'
90103
run: |

0 commit comments

Comments
 (0)