Skip to content

chore(ci): add scheduled workflow run cleanup#48

Merged
prodnull merged 1 commit intomainfrom
chore/cleanup-runs-workflow
May 4, 2026
Merged

chore(ci): add scheduled workflow run cleanup#48
prodnull merged 1 commit intomainfrom
chore/cleanup-runs-workflow

Conversation

@prodnull
Copy link
Copy Markdown
Owner

@prodnull prodnull commented May 4, 2026

Summary

  • Port unix-oidc's cleanup-runs.yml to prmana
  • Mondays 07:00 UTC schedule + on-demand workflow_dispatch
  • Deletes completed runs older than KEEP_DAYS (default 14)

Why

GitHub never expires run metadata. With Dependabot, CodeQL, Security Scanning, Fuzz Testing, and Provider Tests this repo accrued 600+ runs in a few weeks, clogging `gh run list` and the Actions UI.

Security

  • Triggers limited to `schedule` + `workflow_dispatch` (no push/pull_request injection path).
  • Permissions minimal: `actions: write` + `contents: read`.
  • `KEEP_DAYS` validated as integer in [1, 365] before being passed to `date`.

Test plan

  • After merge: `gh workflow run "Cleanup old workflow runs" -R prodnull/prmana -f keep_days=14`
  • Confirm old runs removed

Mirrors unix-oidc's `cleanup-runs.yml`. Trims completed Actions runs
older than KEEP_DAYS (default 14) — runs Mondays 07:00 UTC plus
manual workflow_dispatch.

GitHub keeps run metadata indefinitely by default. Dependabot, CodeQL,
Security Scanning, Fuzz Testing, and Provider Tests stack up fast
(this repo had 600+ runs over a few weeks). Without retention they
clog `gh run list`, the Actions UI, and run-history exports.

Permissions are minimal (`actions: write` + `contents: read`),
triggers exclude push/pull_request to remove any injection path.
@prodnull prodnull merged commit c52aa65 into main May 4, 2026
28 checks passed
@prodnull prodnull deleted the chore/cleanup-runs-workflow branch May 4, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant