Remove old reports #1059
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: Remove old reports | |
on: | |
# Run if files that could be relevant change. | |
push: | |
branches: | |
- master | |
paths: | |
- flake.* | |
- .github/workflows/rm-reports.yml | |
# Run daily | |
schedule: | |
- cron: '0 0 */1 * *' | |
jobs: | |
wait-for-gen-reports: | |
name: Wait for gen-reports | |
uses: ./.github/workflows/wait-for-workflow.yml | |
with: | |
workflow-id: gen-reports.yml | |
rm-reports: | |
name: Remove old reports | |
runs-on: ubuntu-latest | |
needs: wait-for-gen-reports | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
# We need the history | |
fetch-depth: 0 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v14 | |
- name: Remove reports created over a week ago | |
run: | | |
nix run .#rm-reports-older-than -- 1 weeks | |
# We need to force push since this changes the repository history. | |
- name: Push changes | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git push --force |