Skip to content

Commit

Permalink
Iterate on delete (#33)
Browse files Browse the repository at this point in the history
* format

* debug

* try specific format

* run on all files

* get commits

* add permissions
  • Loading branch information
mockersf committed Mar 17, 2024
1 parent e8e3ee1 commit fe2acfc
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/cleanup-old-results.yml
Expand Up @@ -9,27 +9,31 @@ jobs:
cleanup-results:
name: Cleanup Results
runs-on: ubuntu-latest
permissions:
contents: write

steps:

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

- 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
date=`date "+%Y-%m-%d" -d "3 months ago"`
echo $date
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 config user.email '<>'
git add .
git commit -m "Results Cleanup"
git push

0 comments on commit fe2acfc

Please sign in to comment.