Skip to content
tag

GitHub Action

Delete Draft Releases

v1.0.1 Latest version

Delete Draft Releases

tag

Delete Draft Releases

Delete draft releases in your repository

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Delete Draft Releases

uses: hugo19941994/[email protected]

Learn more about this action in hugo19941994/delete-draft-releases

Choose a version

GitHub Action - Delete Draft Releases

This GitHub Action (written in JavaScript) wraps the GitHub Release API to allow you to leverage GitHub Actions to delete draft releases.

Tests

Usage

Pre-requisites

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.

Example workflows

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

Available units of time:

  • seconds s
  • minutes m min
  • hours h hr
  • days d
  • weeks w wk
  • months
  • years y yr

License

The scripts and documentation in this project are released under the MIT License