Skip to content

Instantly share code, notes, and snippets.

@ADTC
Created March 27, 2023 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ADTC/ed42e1a9fdb3537b3bb0ad2fb83016c0 to your computer and use it in GitHub Desktop.
Save ADTC/ed42e1a9fdb3537b3bb0ad2fb83016c0 to your computer and use it in GitHub Desktop.
Clean workflow runs - Delete skipped workflow runs, once a day daily
name: Clean workflow runs
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
# Run at 00:00 everyday. See https://crontab.guru to change.
jobs:
del_workflow_runs:
runs-on: ubuntu-latest
steps:
# This cleans skipped workflow runs.
- name: Delete skipped workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 0
delete_run_by_conclusion_pattern: skipped
# dry_run: true
# This cleans all runs previously generated by this workflow.
# `delete_workflow_pattern` must match the name on line 1.
- name: Delete previous runs of this file
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 0
delete_workflow_pattern: Clean workflow runs
# dry_run: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment