瀏覽代碼

ci: add workflow runs clean up

Cat 1 年之前
父節點
當前提交
611b03e539
共有 1 個文件被更改,包括 20 次插入0 次删除
  1. 20 0
      .github/workflows/workflow_runs_clean_up.yml

+ 20 - 0
.github/workflows/workflow_runs_clean_up.yml

@@ -0,0 +1,20 @@
+name: Delete old workflow runs
+on:
+  workflow_dispatch:
+  schedule:
+    - cron: '0 0 * * *'
+
+jobs:
+  del_runs:
+    runs-on: ubuntu-latest
+    permissions:
+      actions: write
+      contents: read
+    steps:
+      - name: Delete workflow runs
+        uses: Mattraks/delete-workflow-runs@v2
+        with:
+          token: ${{ github.token }}
+          repository: ${{ github.repository }}
+          retain_days: 7
+          keep_minimum_runs: 1