Skip to content

Commit

Permalink
ci: ensure safety checks properly prevent releasing an already releas…
Browse files Browse the repository at this point in the history
…ed version (#18)

Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick authored Aug 5, 2024
1 parent c50af7e commit 8f4698c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/flow-release-legacy-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
with:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install GH CLI
uses: sersoft-gmbh/setup-gh-cli-action@2d02c06e284b7d55e954d6d6406e7a886f45a818 # v2.0.1
with:
Expand All @@ -106,7 +109,7 @@ jobs:

- name: Check for Existing Releases
run: |
if gh release view v${{ needs.versions.outputs.runner }} >/dev/null 2>&1; then
if gh release view v${{ needs.versions.outputs.runner }} --json id >/dev/null 2>&1; then
echo "::error title=Release Version::Release v${{ needs.versions.outputs.runner }} already exists and may not be redeployed."
exit 1
fi
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/zxcron-automatic-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
with:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install GH CLI
uses: sersoft-gmbh/setup-gh-cli-action@2d02c06e284b7d55e954d6d6406e7a886f45a818 # v2.0.1
with:
Expand All @@ -58,7 +61,7 @@ jobs:
id: release
run: |
NEEDED="true"
if gh release view v${{ needs.versions.outputs.runner }} >/dev/null 2>&1; then
if gh release view v${{ needs.versions.outputs.runner }} --json id >/dev/null 2>&1; then
echo "::info title=Release Version::Release v${{ needs.versions.outputs.runner }} already exists and may not be redeployed."
NEEDED="false"
fi
Expand Down

0 comments on commit 8f4698c

Please sign in to comment.