From 4650daf6720d64ca7ae7f0c2e718a2983f9731cb Mon Sep 17 00:00:00 2001 From: Sonu Saha Date: Thu, 5 Sep 2024 13:23:22 +0530 Subject: [PATCH] pass check if no commit is made Signed-off-by: Sonu Saha --- .github/workflows/version_bump.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/version_bump.yml b/.github/workflows/version_bump.yml index 13219cf..976ac82 100644 --- a/.github/workflows/version_bump.yml +++ b/.github/workflows/version_bump.yml @@ -38,7 +38,19 @@ jobs: - name: Bump version run: ruby .github/scripts/version_bump.rb + - name: Check for changes + id: check_changes + run: | + if git diff --exit-code; then + echo "No changes to commit" + echo "changed=false" >> $GITHUB_ENV + else + echo "Changes detected" + echo "changed=true" >> $GITHUB_ENV + fi + - name: Commit and push changes + if: env.changed == 'true' run: | git config user.name "github-actions" git config user.email "actions@github.com"