diff --git a/.github/workflows/cleanup-stale-outputs.yml b/.github/workflows/cleanup-stale-outputs.yml new file mode 100644 index 0000000..722dd7d --- /dev/null +++ b/.github/workflows/cleanup-stale-outputs.yml @@ -0,0 +1,31 @@ +name: Cleanup Stale Outputs + +on: + workflow_dispatch: + push: + paths: + - 'README' + +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-outputs.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 tests + git diff --staged --quiet || (git commit -m "Refactor: Remove stale benchmark outputs" && git push)