Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/visit-dav/dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
brugger1 committed Nov 17, 2024
2 parents d5f748e + 7649cf8 commit c8cc73d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/keep_latest60_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ on:
schedule:
# Runs at 5 AM UTC (10 PM PDT / 9 PM PST)
- cron: '0 5 * * *'
workflow_dispatch: # Allows manual trigger from the GitHub UI
# Allows manual trigger from the GitHub UI
workflow_dispatch:

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cleanup old test results
run: |
# Count the number of top-level directories (assuming they are dated test results)
total_dirs=$(ls -d */ | wc -l)
total_dirs=$(ls -d 20*/ | wc -l)
echo "Total directories: $total_dirs"
# If there are more than 60 directories, delete the oldest
if [ $total_dirs -gt 60 ]; then
# List directories sorted by date and delete the oldest
ls -dt */ | tail -n +61 | xargs rm -rf
ls -dt 20*/ | tail -n +61 | xargs rm -rf
fi
- name: Commit and push changes
Expand Down

0 comments on commit c8cc73d

Please sign in to comment.