delete-older-releases icon indicating copy to clipboard operation
delete-older-releases copied to clipboard

Failed to get list of releases <- Not Found

Open ZaberZiv opened this issue 1 year ago • 13 comments

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...

ZaberZiv avatar Mar 20 '24 05:03 ZaberZiv

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

thadguidry avatar Mar 20 '24 05:03 thadguidry

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

thadguidry avatar Mar 20 '24 06:03 thadguidry

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

Yes, there are two pre-leases that has string in title and tag. image

ZaberZiv avatar Mar 20 '24 06:03 ZaberZiv

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

Just tried this, didn't help.

ZaberZiv avatar Mar 20 '24 06:03 ZaberZiv

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

image

thadguidry avatar Mar 20 '24 06:03 thadguidry

Made using GitHub's GUI (but you might be using the GitHub CLI to make releases? which is fine also)

image image

thadguidry avatar Mar 20 '24 07:03 thadguidry

image

thadguidry avatar Mar 20 '24 07:03 thadguidry

image

ZaberZiv avatar Mar 20 '24 07:03 ZaberZiv

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?

thadguidry avatar Mar 20 '24 07:03 thadguidry

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.

ZaberZiv avatar Mar 20 '24 08:03 ZaberZiv

What was the error or log output?

thadguidry avatar Mar 20 '24 08:03 thadguidry

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...

ZaberZiv avatar Mar 20 '24 08:03 ZaberZiv

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.

thadguidry avatar Apr 01 '24 02:04 thadguidry