Trim old reports #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trim old reports | |
on: | |
push: | |
branches: | |
# So that we can test this action easily: | |
- "**/*trim-action*" | |
workflow_dispatch: | |
schedule: | |
# Run at 3:03am on the 3rd of the month | |
- cron: "3 3 3 * *" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
trim: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v2 | |
- name: Remove old reports | |
run: | | |
ls -1d reports/$(date -d "7 months ago" +%Y%m)* | xargs git rm -r | |
git config user.name 'Ned Batchelder' | |
git config user.email 'ned@nedbatchelder.com' | |
git commit -m 'trim reports older than six months' | |
git push |