delete-older-releases
delete-older-releases copied to clipboard
Failed to get list of releases <- Not Found
Hi! Keep getting error, seems like your script can't find my releases.
Here what I add to my file:
- name: Delete uses: dev-drprasad/[email protected] with: keep_latest: 0 delete_tags: true delete_tag_pattern: Pre-Release env: GITHUB_TOKEN: ${{ secrets.TOKEN }}
Here what I get:
Run dev-drprasad/[email protected]
💬 no repo name given. fall-ing back to this repo
🌶 given keep_latest is 0, this will wipe out all releases
🔖 corresponding tags also will be deleted
releases matching Pre-Release will be targeted
🌶 given keep_min_download_counts is 0, this will not enable the download count removal rule
🌶 given delete_expired_data is 0
🌶 failed to get list of releases <- Not Found
exiting...
Are you sure you have some releases that have the string Pre-Release somewhere in their tags?
Example:
Release Title = myAwesomeApp-v3.2
Release Git Tag = v3.2_Pre-Release
Also, if you are looking to delete categorical "Pre-releases" https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
Optionally, to notify users that the release is not ready for production and may be unstable, select This is a pre-release.
, then you would use our parameter delete_prerelease_only.
name: Delete
uses: dev-drprasad/[email protected]
with:
keep_latest: 0
delete_tags: true
delete_tag_pattern: v3\.2
delete_prerelease_only: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
NOTE REMINDER: delete_tag_pattern takes a Regex pattern.
https://github.com/dev-drprasad/delete-older-releases?tab=readme-ov-file#delete_tag_pattern
Are you sure you have some releases that have the string
Pre-Releasesomewhere in their tags? Example: Release Title = myAwesomeApp-v3.2 Release Git Tag = v3.2_Pre-Release
Yes, there are two pre-leases that has string in title and tag.
Also, if you are looking to delete categorical "Pre-releases" https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
Optionally, to notify users that the release is not ready for production and may be unstable, select This is a pre-release.
, then you would use our parameter
delete_prerelease_only.name: Delete uses: dev-drprasad/[email protected] with: keep_latest: 0 delete_tags: true delete_tag_pattern: v3\.2 delete_prerelease_only: true env: GITHUB_TOKEN: ${{ secrets.TOKEN }}NOTE REMINDER:
delete_tag_patterntakes a Regex pattern. https://github.com/dev-drprasad/delete-older-releases?tab=readme-ov-file#delete_tag_pattern
Just tried this, didn't help.
That string in your RELEASE TITLE is "Pre-Release v2.19.14" What is the RELEASE TAG ? Example quick demonstration pre-release I made in one of my repos: https://github.com/thadguidry/do-spaces-action/releases/tag/v2.19.14
Made using GitHub's GUI (but you might be using the GitHub CLI to make releases? which is fine also)
So just to point something out that I spotted and to make you aware of, your Git Tag for that commit 1ba1189 is actually v.2.19.14-beta where it seems you have a . between the v and the 2. Typically as a best practice you don't put a . dot after the v. If you wanted a better semantic versioning strategy, it's best to prefix with 0 if you are not yet 1.0, so for example, v0.2.19.14-beta, but perhaps you simply accidentally added the . and you have a real semantic version of v2.19.14-beta.
If you have many pre-releases and multiple tags, perhaps you want to omit using the actions parameter delete_tag_pattern which will not filter on any tags and hence will remove all tags, the only other filtering mechanism is the actions parameter delete_prerelease_only.
So if you did this:
name: Delete
uses: dev-drprasad/[email protected]
with:
keep_latest: 0
delete_tags: true
delete_prerelease_only: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
Then that will essentially delete all prereleases, no matter what the labels of any of the releases' tags are. If any of your releases are categorized as a Pre-release then it will get deleted. Maybe that's what you really want?
Thanks for explanation. Well yes, I just want to delete all existing pre-releases before add new one. Just tried run your script and it didn't help.
What was the error or log output?
Run dev-drprasad/[email protected]
💬 no repo name given. fall-ing back to this repo
🌶 given keep_latest is 0, this will wipe out all releases
🔖 corresponding tags also will be deleted
🔖 Remove only prerelease
🌶 given keep_min_download_counts is 0, this will not enable the download count removal rule
🌶 given delete_expired_data is 0
🌶 failed to get list of releases <- Not Found
exiting...
I think we might have exposed a recently introduced bug in their GitHub Releases API... I've detailed what might be happening in another user's similar report in issue #44 , so please take a look at that issue. We'll keep this issue open until GitHub helps resolve things or explains more what changed.