File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,11 +129,24 @@ jobs:
129129 id : get-new-version
130130 run : echo "NEW_VERSION=${{ needs.build.outputs.new_version }}" >> $GITHUB_OUTPUT
131131
132+ - name : Get previous tag
133+ id : previous-tag
134+ run : |
135+ # Get the most recent tag (excluding the current commit's tags)
136+ PREV_TAG=$(git tag --sort=-version:refname | head -1)
137+ if [ -z "$PREV_TAG" ]; then
138+ # If no tags exist, use the initial commit
139+ PREV_TAG=$(git rev-list --max-parents=0 HEAD)
140+ fi
141+ echo "PREV_TAG=$PREV_TAG" >> $GITHUB_OUTPUT
142+
132143 - name : Generate Changelog
133144 id : changelog
134145 uses : mikepenz/release-changelog-builder-action@v6
135146 with :
136147 token : ${{ secrets.GH_TOKEN }}
148+ fromTag : ${{ steps.previous-tag.outputs.PREV_TAG }}
149+ toTag : HEAD
137150 configuration : |
138151 {
139152 "categories": [
You can’t perform that action at this time.
0 commit comments