Skip to content

Not Found (HTTP 404) in 'Cleanup old releases' job #5

Description

@Ban3

I couldn't find matching endpoint for gh api repos/${{ github.repository }}/releases/tags/$release -X DELETE in the Delete a release documentation. If I change the job definition to use ids like in the documentation it does seem to work.

# Keep only the last 3 releases
RELEASES=$(gh api repos/${{ github.repository }}/releases --jq '.[].id' | head -n 3)
for release in $(gh api repos/${{ github.repository }}/releases --jq '.[].id'); do
    if ! echo "$RELEASES" | grep -q "$release"; then
       gh api repos/${{ github.repository }}/releases/$release -X DELETE
    fi
done

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions