Skip to content

Commit

Permalink
skip push if empty commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Volak committed Feb 6, 2024
1 parent f300173 commit 946bd9a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####
Expand Down Expand Up @@ -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/}
Expand All @@ -95,7 +95,7 @@ jobs:
git config --global user.email "[email protected]"
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
Expand All @@ -111,6 +111,5 @@ jobs:
git config --global user.email "[email protected]"
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

0 comments on commit 946bd9a

Please sign in to comment.