Skip to content

Commit

Permalink
fix: [Github workflow] Proper test for redundant release workflow runs
Browse files Browse the repository at this point in the history
* `release.yaml` now uses proper check to skip redundant runs - check is
  done between `nextStrict` and `current` versions, since
  `release-action` uses the former thus creating the tags after the
  version
  • Loading branch information
hostcc committed Aug 24, 2024
1 parent f744046 commit 5b94fe7
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,21 @@ jobs:
- name: Set version in manifest and commit that
uses: maxgfr/github-change-json@v0.0.26
# Only perform release-related actions if new version is generated, do
# nothing otherwise - primiry use case to prevent another run of the
# workflow triggered when manifest is updated (see below)
if: >-
steps.version.outputs.next !=
steps.version.outputs.current
# Only perform release-related actions if new version is generated
# (check is done between `nextStrict` and `current` versions, since
# `release-action` below uses the former thus creating the tags after
# the version) , do nothing otherwise - primary use case to prevent
# another run of the workflow triggered when manifest is updated (see
# below)
if: steps.version.outputs.nextStrict != steps.version.outputs.current
with:
key: version
value: ${{ steps.version.outputs.nextStrict }}
path: custom_components/gs_alarm/manifest.json

- name: Commit updated manifest
# See comment above
if: >-
steps.version.outputs.next !=
steps.version.outputs.current
if: steps.version.outputs.nextStrict != steps.version.outputs.current
run: |
git config --local user.email \
"github-actions[bot]@users.noreply.github.com"
Expand All @@ -68,9 +67,7 @@ jobs:
- name: Push changes
uses: ad-m/github-push-action@master
# See comment above
if: >-
steps.version.outputs.next !=
steps.version.outputs.current
if: steps.version.outputs.nextStrict != steps.version.outputs.current
with:
# SSH (deploy) key allows to bypass branch protection on default
# branch
Expand All @@ -80,9 +77,7 @@ jobs:
- name: Create release
uses: ncipollo/release-action@v1
# See comment above
if: >-
steps.version.outputs.next !=
steps.version.outputs.current
if: steps.version.outputs.nextStrict != steps.version.outputs.current
with:
# Base the release off of the tip of default branch
commit: ${{ github.event.repository.default_branch }}
Expand Down

0 comments on commit 5b94fe7

Please sign in to comment.