From 1ec90bbec83342fcf375e36c0ef59f10e796c0a9 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Fri, 1 Nov 2024 11:34:34 -0600 Subject: [PATCH 1/2] restore quite fail for commit --- .github/actions/commit_and_push/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/commit_and_push/action.yml b/.github/actions/commit_and_push/action.yml index 3225a29d68..063208d99c 100644 --- a/.github/actions/commit_and_push/action.yml +++ b/.github/actions/commit_and_push/action.yml @@ -29,5 +29,9 @@ runs: # Add and commit changes if there are any git add --all - git commit -m "${{ inputs.commit-message }}" - git push origin "${{ inputs.branch-name }}" + if ! git diff --cached --quiet; then + git commit -m "${{ inputs.commit-message }}" + git push origin "${{ inputs.branch-name }}" + else + echo "No changes to commit. Skipping commit and push." + fi From c0ce5aa0d315c1f70521fbc82f5b82c39adeb2e5 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Fri, 1 Nov 2024 11:46:56 -0600 Subject: [PATCH 2/2] add comment --- .github/actions/commit_and_push/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/commit_and_push/action.yml b/.github/actions/commit_and_push/action.yml index 063208d99c..71d0f8b8b5 100644 --- a/.github/actions/commit_and_push/action.yml +++ b/.github/actions/commit_and_push/action.yml @@ -33,5 +33,6 @@ runs: git commit -m "${{ inputs.commit-message }}" git push origin "${{ inputs.branch-name }}" else + # Skip since the above commands exit with 1 if there are no changes to commit echo "No changes to commit. Skipping commit and push." fi