Skip to content

Commit 54c7324

Browse files
Merge pull request #12 from Githubguy132010/patch2
Optimizing build.yaml
2 parents b7e8ef9 + 54a13de commit 54c7324

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,29 @@ jobs:
7575
asset_name: Arch.iso
7676
asset_content_type: application/octet-stream
7777

78+
# Delete the release after uploading the asset
79+
- name: Delete GitHub Release
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
RELEASE_ID: ${{ steps.create_release.outputs.release_id }}
83+
run: |
84+
curl -X DELETE \
85+
-H "Authorization: token $GITHUB_TOKEN" \
86+
-H "Accept: application/vnd.github.v3+json" \
87+
https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID
88+
89+
# Delete the tag associated with the release
90+
- name: Delete Git Tag
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
TAG_NAME: v${{ github.run_id }}-release
94+
run: |
95+
curl -X DELETE \
96+
-H "Authorization: token $GITHUB_TOKEN" \
97+
-H "Accept: application/vnd.github.v3+json" \
98+
https://api.github.com/repos/${{ github.repository }}/git/refs/tags/$TAG_NAME
99+
78100
- name: Clean Up
79101
run: |
80102
docker stop arch-container || echo 'Failed to stop the container.'
81-
docker rm arch-container || echo 'Failed to remove the container.'
103+
docker rm arch-container || echo 'Failed to remove the container.'

0 commit comments

Comments
 (0)