forked from package-url/packageurl-js
-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (45 loc) · 1.54 KB
/
Copy pathprune-workflow-runs.yml
File metadata and controls
50 lines (45 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: 🧹 Prune Workflow Runs
# Deletes stale GitHub Actions run history on a weekly cadence:
# - runs older than the retention window for workflows still present on the
# default branch, and
# - ALL runs for workflows whose source is gone from the default branch.
# See scripts/fleet/prune-workflow-runs.mts. Byte-identical across the fleet
# (cascaded); edit template/base/.github/workflows/prune-workflow-runs.yml and
# re-cascade via `pnpm run sync`.
on:
schedule:
# Sundays at 04:00 UTC — off-peak, clear of the daily/weekly update runs.
- cron: '0 4 * * 0'
workflow_dispatch:
inputs:
days:
description: 'Retention window in days for present workflows'
required: false
type: string
default: '15'
dry-run:
description: 'Report what would be deleted without deleting'
required: false
type: boolean
default: false
permissions:
actions: write
contents: read
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
prune:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b3f42a5f19c0a3854a67a8387c97ed0bb77caa00 # main (2026-06-09)
- name: Prune workflow runs
env:
GH_TOKEN: ${{ github.token }}
run: |
ARGS=(--days "${{ inputs.days || '15' }}")
if [ "${{ inputs.dry-run }}" = "true" ]; then
ARGS+=(--dry-run)
fi
node scripts/fleet/prune-workflow-runs.mts "${ARGS[@]}"