File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 : |
You can’t perform that action at this time.
0 commit comments