Skip to content

Commit 3b77437

Browse files
authored
Merge pull request #58 from avrae/feat/workflow-prune
feat: workflow prune action
2 parents 87da6ea + ff5d574 commit 3b77437

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/prune-old-runs.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Prune Old Workflow Runs & Artifacts
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
6+
workflow_dispatch: # Allows manual execution
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
actions: write
13+
contents: read
14+
steps:
15+
- name: Delete workflow runs
16+
uses: Mattraks/delete-workflow-runs@v2
17+
with:
18+
token: ${{ github.token }}
19+
repository: ${{ github.repository }}
20+
retain_days: 7
21+
keep_minimum_runs: 1
22+
23+
- name: Delete old artifacts
24+
uses: c-hive/gha-remove-artifacts@v1
25+
with:
26+
age: "7 days"
27+
skip-recent: 1

0 commit comments

Comments
 (0)