action-gh-release
action-gh-release copied to clipboard
Option to fail on existing tag
Hi! We are using action-gh-release to release our packages and create release tags. We want to prevent an accidental situation of releasing the same version again. I'm using now scripts that check if the tag exists and fails if so, but it would be so much more convenient to have just an option for it in this gh action!
I agree, this would be a nice feature.
I just had a big problem because I wouldn't expect draft: true to change an existing non-draft release in any way, even if the draft has same tag_name (and name) as an existing release. But it just changed an asset! If I didn't have a local backup, I could have lost the original file!!! I had to edit the already published release to restore that file!
Strangely, it didn't change the release text, just the uploaded file (which had the same name). It also didn't create a new release or draft. This has to be a bug.
Run softprops/action-gh-release@v1
with:
draft: true
files: [...]
fail_on_unmatched_files: true
tag_name: v0.0.1
body_path: ./.github/RELEASE-NOTES-v0.0.1.md
token: ***
♻️ Deleting previously uploaded asset [...]
⬆️ Uploading [...]
Someone can still be testing things, and not have updated the tag yet. So please fix this, and never allow a draft to change anything in a non-draft release. The draft property could be part of the "primary key" (so to speak) along with (tag)name when deciding if it should replace it.
Or implement this feature request, which could have at least prevented this.