Skip to content

Commit

Permalink
Added exclusions list
Browse files Browse the repository at this point in the history
  • Loading branch information
XargonWan authored Jan 14, 2025
1 parent 2a02675 commit 753688a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/delete-old-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
run: |
# Define the threshold date (1 month ago)
THRESHOLD_DATE=$(date -d "1 month ago" +%Y-%m-%dT%H:%M:%SZ)
# Define the list of tags to be excluded
EXCLUDE_TAGS=("cooker-0.9.0b-ShoujoMonster")
# Get all releases (handle pagination)
ALL_RELEASES=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases?per_page=100&page=1")
Expand All @@ -38,6 +41,11 @@ jobs:
if [ "$RELEASE_ID" == "$LATEST_RELEASE" ]; then
continue
fi
# Skip releases with tags in the exclude list
if [[ " ${EXCLUDE_TAGS[@]} " =~ " ${TAG_NAME} " ]]; then
continue
fi
# Check if the release is older than 1 month
OLD_RELEASES=$(echo "$ALL_RELEASES" | jq --arg threshold "$THRESHOLD_DATE" ".[$i] | select(.published_at < \$threshold) | .id")
Expand Down

0 comments on commit 753688a

Please sign in to comment.