Skip to content

Commit 89d1a65

Browse files
committed
feat: add changelog
1 parent 5bb1232 commit 89d1a65

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,23 @@ jobs:
2020
with:
2121
persist-credentials: false # This is important if you have branch protection rules!
2222
- name: Semantic Release
23+
id: semantic
2324
uses: cycjimmy/semantic-release-action@v4
2425
with:
2526
branch: 'main'
27+
extra_plugins: |
28+
@semantic-release/changelog
2629
env:
2730
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2831
- name: Get Semantic Release Version
2932
id: get-version
3033
run: |
31-
echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')"
34+
version="${{ steps.semantic.outputs.new_release_version }}"
35+
if [ -z "$version" ]; then
36+
# No new release in this run (e.g. scheduled build) -> fall back to latest tag
37+
version="$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')"
38+
fi
39+
echo "version=${version}" >> "$GITHUB_OUTPUT"
3240
3341
- name: show version
3442
run: |

0 commit comments

Comments
 (0)