Skip to content

Commit f017f73

Browse files
committed
Add workflow cleaning action
1 parent a588048 commit f017f73

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Clean Workflow Logs
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 2" # Runs "At 00:00 on Tuesday." (see https://crontab.guru)
6+
7+
workflow_dispatch:
8+
inputs:
9+
runs_older_than:
10+
description: "The amount of days old to delete"
11+
default: "21"
12+
required: false
13+
14+
env:
15+
SCHEDULED_RUNS_OLDER_THAN: "21"
16+
SCHEDULED_RUNS_TO_KEEP: "0"
17+
18+
jobs:
19+
clean-logs:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
actions: write
23+
steps:
24+
- uses: igorjs/gh-actions-clean-workflow@v6
25+
with:
26+
runs_older_than: ${{ github.event.inputs.runs_older_than || env.SCHEDULED_RUNS_OLDER_THAN }}
27+
runs_to_keep: ${{ github.event.inputs.runs_to_keep || env.SCHEDULED_RUNS_TO_KEEP }}
28+

0 commit comments

Comments
 (0)