Skip to content

AlbertCintas/delete-draft-releases

 
 

Repository files navigation

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

About

Github Action to delete all draft releases in a repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%