From 0170e2b058ded5a917c46dacc4eb0ce771981f4d Mon Sep 17 00:00:00 2001 From: charles Date: Wed, 16 Aug 2023 12:39:09 -0600 Subject: [PATCH] ci: check for dirty tree before committing in commit step --- .github/workflows/release.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a72525a..bbff879a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,8 +28,14 @@ jobs: run: | git config --local user.name "Github Action" git config user.email "action@github.com" - git commit -a -m "docs: bump version to ${{ steps.semver.outputs.git_tag }}" - git tag ${{ steps.semver.outputs.git_tag }} + + # Check for changes + if ! git diff-index --quiet HEAD --; then + git commit -a -m "docs: bump version to ${{ steps.semver.outputs.git_tag }}" + git tag ${{ steps.semver.outputs.git_tag }} + else + echo "No changes detected. Skipping commit and tag." + fi - name: Push Changes if: steps.semver.outputs.version != '' @@ -39,6 +45,7 @@ jobs: tags: true - name: Nightly Merge + if: steps.semver.outputs.version != '' uses: robotology/gh-action-nightly-merge@v1.4.0 with: allow_ff: true