This GitHub Action (written in JavaScript) wraps the GitHub Release API to allow you to leverage GitHub Actions to delete draft releases.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
No outputs are available in this version.
Only the first 30 releases from a repo are checked.
On every push
it deletes any release marked as a draft:
on:
push:
name: Delete Draft Releases
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Delete drafts
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
To delete drafts older than a certain amount of time you can use the threshold input
on:
push:
name: Delete Draft Releases older than 5 days
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Delete drafts
uses: hugo19941994/[email protected]
with:
threshold: 5d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The minimum amount of time is 1 second
- seconds
s
- minutes
m
min
- hours
h
hr
- days
d
- weeks
w
wk
- months
- years
y
yr
The scripts and documentation in this project are released under the MIT License