Skip to content

Instantly share code, notes, and snippets.

@jainamoswal
Created August 22, 2021 07:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jainamoswal/77d228bb8d8d6c512a960ec8e95eaec5 to your computer and use it in GitHub Desktop.
Save jainamoswal/77d228bb8d8d6c512a960ec8e95eaec5 to your computer and use it in GitHub Desktop.

To delete all your workflow runs, use this workflow file .github/workflows/clean.yml in your root directory and run it via workflow_dispatch.

name: 🗑 Delete workflow runs 🗑
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: "5"
minimum_runs:
description: 'Minimum runs to keep.'
required: true
default: "1"
jobs:
delete_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment