Skip to content

run 10pm pt

run 10pm pt #2

name: Keep latest 60 results

Check failure on line 1 in .github/workflows/keep_latest60_results.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/keep_latest60_results.yml

Invalid workflow file

invalid `cron` attribute "0 6 * 12-2 *"
on:
schedule:
# Runs at 6 AM UTC from November to March (10 PM PST)
- cron: '0 6 1-14 3,11 *'
- cron: '0 6 * 12-2 *'
# Runs at 5 AM UTC from March to November (10 PM PDT)
- cron: '0 5 15-31 3,11 *'
- cron: '0 5 * 4-10 *'
workflow_dispatch: # Allows manual trigger from the GitHub UI
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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)
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
fi
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add -A
git commit -m "Removed old test results to maintain last 60 results" || echo "No changes to commit"
git push