Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/release-auto-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
fi
echo "Latest tag: $latest"

# Skip if no new commits since the latest tag
commit_count=$(git rev-list "${latest}..HEAD" --count)
echo "Commits since $latest: $commit_count"
if [ "$commit_count" -eq 0 ]; then
echo "No new commits since $latest — skipping tag creation"
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi

major=$(echo "$latest" | sed 's/^v//' | cut -d. -f1)
minor=$(echo "$latest" | sed 's/^v//' | cut -d. -f2)
patch=$(echo "$latest" | sed 's/^v//' | cut -d. -f3)
Expand All @@ -48,11 +57,13 @@ jobs:
echo "Next tag: $next"

- name: Create and push tag
if: steps.version.outputs.skip != 'true'
run: |
git tag ${{ steps.version.outputs.next }}
git push origin ${{ steps.version.outputs.next }}

- name: Trigger Release Tag workflow
if: steps.version.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
Loading