This action can delete release/pre-release/draft of given repo.
Optional Operation target repository, the format is "owner/repo", default is current repo.
Optional Whether to delete the release, default is false
.
Optional The number of releases except the latest release reserved, "-1" means delete all, default is 0
.
Optional Whether to delete the tag of release, default is true
.
Optional Whether to delete the pre-release, default is false
.
Optional The number of pre-releases except the latest pre-release reserved, "-1" means delete all, default is 0
.
Optional Whether to delete the tag of pre-release, default is true
.
Optional Whether to delete the draft, default is true
.
This example will:
- Keep the latest 3 releases, delete the rest and their tags.
- Drop all the pre-release and their tag.
- Drop all the draft release.
- uses: sgpublic/delete-release-action@main
with:
# repo: '<owner>/<repoName>' # you can input a another repo here, defaults to current repo
release-drop: true
release-keep-count: 2
release-drop-tag: true
pre-release-drop: true
pre-release-keep-count: -1
pre-release-drop-tag: true
draft-drop: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
It is possible for the same tag to have multiple releases, so we recommend enabling draft-drop
when enabling *-drop-tag
.