From 9f93c0846dd25137018d2b12507b14f4062a4dda Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 15 Jul 2024 21:11:59 +0100 Subject: [PATCH] Use GitHub Actions if to stop flow instead of crashing it --- .github/workflows/create-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 84f6ce0..b2e3cb0 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -22,10 +22,11 @@ jobs: run: | CHANGES=$(git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline) echo "$CHANGES" - if [ -z "$CHANGES" ]; then exit 1; else exit 0; fi + if [ -z "$CHANGES" ]; then echo "changes=false" >> "$GITHUB_OUTPUT"; else echo "changes=true" >> "$GITHUB_OUTPUT"; fi - name: Bump version and push tag id: tag_version + if: steps.changes.outputs.changes == 'true' uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -33,6 +34,7 @@ jobs: # default_bump: false - name: Create a GitHub release + if: steps.changes.outputs.changes == 'true' uses: ncipollo/release-action@v1 with: tag: ${{ steps.tag_version.outputs.new_tag }}