Skip to content

Commit

Permalink
Revert "Fix deletion of old releases (#42)"
Browse files Browse the repository at this point in the history
This reverts commit 8cba691.
  • Loading branch information
fmeum authored Jan 3, 2025
1 parent 8cba691 commit 94f144a
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,7 @@ jobs:
run: git push origin --delete nightly || true
- name: Delete existing nightly release
run: |
TAG_NAME=nightly
# Fetch the release associated with the tag
RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/releases/tags/$TAG_NAME")
# Check if a release was found
RELEASE_ID=$(echo "$RESPONSE" | jq -r ".id")
if [[ "$RELEASE_ID" == "null" || -z "$RELEASE_ID" ]]; then
echo "No release found for tag: $TAG_NAME"
else
echo "Deleting release with ID: $RELEASE_ID"
curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/releases/$RELEASE_ID"
fi
# Delete the tag.
RESPONSE=$(curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/git/refs/tags/$TAG_NAME")
# Check for success
if echo "$RESPONSE" | grep -q '"message":'; then
echo "Error: $(echo "$RESPONSE" | jq -r '.message')"
else
echo "Tag '$TAG_NAME' deleted successfully."
fi
curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/nightly
- name: Release
uses: softprops/action-gh-release@v2
with:
Expand Down

0 comments on commit 94f144a

Please sign in to comment.