Feat: Add workflow to prune stale test results

This commit is contained in:
2025-11-26 17:40:32 -08:00
parent 1207c6f66b
commit 32e75fee8d

30
.github/workflows/cleanup-tests.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Cleanup Stale Tests
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Weekly
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run cleanup script
run: node scripts/cleanup-results.js
- name: Commit and push if changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add results.json
git diff --staged --quiet || (git commit -m "Chore: Remove stale test results" && git push)