From 946bd9a77e14dd2722b3228519790cbf7409aa1a Mon Sep 17 00:00:00 2001 From: Jozef Volak Date: Tue, 6 Feb 2024 11:17:43 +0100 Subject: [PATCH] skip push if empty commit --- .github/workflows/docker-publish.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 11bb5a6b73..47aa442fec 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -51,7 +51,7 @@ jobs: #### Docker latest publish #### # - name: Push latest image - # if: startsWith(github.ref, 'refs/tags/master') + # if: startsWith(github.ref, 'refs/heads/master') # run: docker push $IMAGE_NAME:latest #### Docker release publish #### @@ -85,7 +85,7 @@ jobs: fetch-depth: 2 - name: Commit swagger latest - if: startsWith(github.ref, 'refs/tags/swagger_publish') + if: startsWith(github.ref, 'refs/heads/swagger_publish') run: | git_hash=$(git rev-parse --short "$GITHUB_SHA") git_branch=${GITHUB_REF#refs/heads/} @@ -95,7 +95,7 @@ jobs: git config --global user.email "support@frinx.io" git config --global user.name "FRINXrepo" git add latest.json - git commit -am "Updated swagger for ${git_branch}/${git_hash}" + (git commit -am "Updated swagger for ${git_branch}/${git_hash}" && git push) || echo "Nothing to commit" git push popd @@ -111,6 +111,5 @@ jobs: git config --global user.email "support@frinx.io" git config --global user.name "FRINXrepo" git add production.json v${{ steps.get_version.outputs.VERSION }}.json - git commit -am "Updated swagger for ${git_branch}/${git_hash}" - git push + (git commit -am "Updated swagger for ${git_branch}/${git_hash}" && git push) || echo "Nothing to commit" popd