Skip to content

Commit 70267ba

Browse files
committed
fix: force-tag full release and gate discussion on publish
## What Added -f flag to full tag creation and push in the create_release job, and gated the release_discussion job on inputs.publish. ## Why Without -f, workflow reruns fail with "tag already exists" when the full tag was created before a downstream job failed. The short tag already used -f, so this was an inconsistency. The discussion job ran unconditionally, which would announce draft releases publicly before they were published. ## Notes - Force-pushing tags rewrites git history for that tag — acceptable here since the tag points to the same commit on rerun - Callers using `publish: false` will no longer get discussion announcements, which is a behavior change for any existing consumers relying on that Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent 8905ed5 commit 70267ba

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ jobs:
114114
echo "SHORT_TAG=$short_tag" >> "$GITHUB_OUTPUT"
115115
- name: Create and push tags
116116
run: |
117-
git tag "${{ steps.release-drafter.outputs.tag_name }}"
117+
git tag -f "${{ steps.release-drafter.outputs.tag_name }}"
118118
git tag -f "${{ steps.get_tag_name.outputs.SHORT_TAG }}" "${{ steps.release-drafter.outputs.tag_name }}"
119-
git push origin "${{ steps.release-drafter.outputs.tag_name }}"
119+
git push -f origin "${{ steps.release-drafter.outputs.tag_name }}"
120120
git push -f origin "${{ steps.get_tag_name.outputs.SHORT_TAG }}"
121121
122122
release_goreleaser:
@@ -287,7 +287,7 @@ jobs:
287287
288288
release_discussion:
289289
needs: create_release
290-
if: ${{ needs.create_release.outputs.full-tag != '' }}
290+
if: ${{ inputs.publish && needs.create_release.outputs.full-tag != '' }}
291291
runs-on: ubuntu-latest
292292
permissions:
293293
contents: read # Required by harden-runner

0 commit comments

Comments
 (0)