GitHub action to purge old workflow runs
authorColin Clark <colin.clark@cclark.uk>
Sun, 18 Jun 2023 11:56:16 +0000 (12:56 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sun, 18 Jun 2023 11:56:16 +0000 (12:56 +0100)
.github/workflows/delete-workflow-runs.yml [new file with mode: 0644]

diff --git a/.github/workflows/delete-workflow-runs.yml b/.github/workflows/delete-workflow-runs.yml
new file mode 100644 (file)
index 0000000..a062006
--- /dev/null
@@ -0,0 +1,19 @@
+name: Delete workflow runs
+on:
+  schedule:
+    - cron: '0 0 * * *'
+# Run daily, at 00:00.
+
+jobs:
+  Delete-Workflow-Runs:
+    runs-on: ubuntu-latest
+    permissions:
+      actions: write
+    steps:
+      - name: Delete workflow runs
+        uses: Mattraks/delete-workflow-runs@v2
+        with:
+          token: ${{ github.token }}
+          repository: ${{ github.repository }}
+          retain_days: 10
+          keep_minimum_runs: 6