fix: delete existing version artifact

* Delete existing version artifact if it exists
* Upload `versions.txt` only on first successful job
This commit is contained in:
Kyle Affolder
2025-02-10 23:16:20 -05:00
parent e052f435db
commit b9ccd16a02
+7
View File
@@ -118,7 +118,14 @@ jobs:
- name: Verify Saved Versions
run: cat versions.txt
- name: Delete Existing Version Artifact (If Exists)
run: gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/$(gh api repos/${{ github.repository }}/actions/artifacts --jq '.artifacts[] | select(.name=="version-metadata") | .id')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Version File
# Always run this on the first successful job only
if: github.run_attempt == 1
uses: actions/upload-artifact@v4.6.0
with:
name: version-metadata