From c662c7a36f6c31c15858e7656c652f864c9d5aaf Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Fri, 5 May 2023 12:02:50 -0400 Subject: [PATCH] use diff-index to prevent commit instead of bash if preferred because the if suppresses all git commit errors, instead of the one error we need to suppress (commit with no changes) --- .github/workflows/snapshot-on-push-master.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml index 50f5cd296..cba5b89dd 100644 --- a/.github/workflows/snapshot-on-push-master.yml +++ b/.github/workflows/snapshot-on-push-master.yml @@ -115,9 +115,8 @@ jobs: git config push.default simple git add -A # prevent failure when there is nothing to commit - if git commit -m "Updated from https://github.com/cc65/cc65/commit/${GITHUB_SHA}" ; then - git push - fi + git diff-index --quiet HEAD || git commit -m "Updated from https://github.com/cc65/cc65/commit/${GITHUB_SHA}" + git push # enter secrets under "repository secrets" - name: Upload snapshot to sourceforge