Skip to content

Commit fe058df

Browse files
authored
Add step to delete release and tag on failure in CI workflow.
1 parent c592015 commit fe058df

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/release_build.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ jobs:
1919
shell: msys2 {0}
2020
run: |
2121
./install.sh
22+
23+
- name: Delete release and tag on failure
24+
if: failure()
25+
run: |
26+
# Install GitHub CLI
27+
choco install gh -y
28+
29+
# Authenticate GitHub CLI
30+
gh auth login --with-token < $env:GITHUB_TOKEN
31+
32+
# Delete the release and tag
33+
gh release delete $env:GITHUB_REF_NAME --cleanup-tag --yes
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
GITHUB_REF_NAME: ${{ github.event.release.tag_name }}
37+
2238
# Upload artifacts to the release
2339
- name: Upload to GitHub Release
2440
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)