Skip to content

Commit

Permalink
trying to fix cleanup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
devl00p committed Sep 17, 2024
1 parent 59f57cf commit 35401c5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
current_date=$(date +%s)
gh release list --limit 100 | while read -r release; do
release_date=$(echo $release | awk '{print $NF}')
release_date_seconds=$(date -d $release_date +%s)
release_id=$(echo $release | awk '{print $1}')
gh release list --limit 100 --json id,createdAt --jq '.[] | [.id, .createdAt] | @tsv' | \
while IFS=$'\t' read -r release_id release_date; do
release_date_seconds=$(date -d "$release_date" +%s)
release_age_days=$(( (current_date - release_date_seconds) / 86400 ))
if [ $release_age_days -gt 30 ]; then
echo "Deleting release $release_id (age: $release_age_days days)"
gh release delete $release_id --yes
gh release delete "$release_id" --yes
fi
done

0 comments on commit 35401c5

Please sign in to comment.