Skip to content

Commit

Permalink
cleanup job (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Mar 17, 2024
1 parent a15ffbd commit e8e3ee1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cleanup-old-results.yml
@@ -0,0 +1,35 @@
name: Cleanup old results

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
cleanup-results:
name: Cleanup Results
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
with:
ref: "results"

- name: Delete old results
run: |
date=`date -d "3 months ago"`
git ls-files | while read file
do
if [ "$(git log --since \"$date\" -- $file)" == "" ]; then
rm "$file"
fi
done
- name: Store results in git
run: |
git config user.name 'Workflow'
git config user.email '<>'
git add .
git commit -m "Results Cleanup"
git push

0 comments on commit e8e3ee1

Please sign in to comment.