Skip to content

Commit 3067468

Browse files
committed
fix release workflow yaml syntax and changelog bootstrap step
1 parent 1c0a646 commit 3067468

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ jobs:
8484
tag="${{ steps.bump.outputs.tag }}"
8585
8686
if [ ! -f CHANGELOG.md ]; then
87-
cat > CHANGELOG.md <<'EOC'
88-
# Changelog
89-
90-
All notable changes to this project will be documented in this file.
91-
EOC
87+
printf '# Changelog\n\nAll notable changes to this project will be documented in this file.\n' > CHANGELOG.md
9288
fi
9389
9490
tmpfile="$(mktemp)"
@@ -137,7 +133,19 @@ EOC
137133
git push origin "$tag"
138134
139135
- name: Publish GitHub release
140-
uses: softprops/action-gh-release@v2
141-
with:
142-
tag_name: ${{ steps.bump.outputs.tag }}
143-
generate_release_notes: true
136+
shell: bash
137+
env:
138+
GH_TOKEN: ${{ github.token }}
139+
run: |
140+
set -euo pipefail
141+
142+
tag="${{ steps.bump.outputs.tag }}"
143+
144+
if gh release view "$tag" >/dev/null 2>&1; then
145+
echo "Release $tag already exists"
146+
exit 0
147+
fi
148+
149+
gh release create "$tag" \
150+
--title "Release $tag" \
151+
--generate-notes

0 commit comments

Comments
 (0)