diff --git a/.github/workflows/delete_stale_workflow.yaml b/.github/workflows/delete_stale_workflow.yaml new file mode 100644 index 0000000..3f012fd --- /dev/null +++ b/.github/workflows/delete_stale_workflow.yaml @@ -0,0 +1,24 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + inputs: + days: + description: "Number of days." + required: true + default: 7 + minimum_runs: + description: "The minimum runs to keep for each workflow." + required: true + default: 5 + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}