mirror of
https://github.com/RetroDECK/Cooker.git
synced 2025-04-10 19:15:11 +00:00
Added exclusions list
This commit is contained in:
parent
2a02675fa1
commit
753688ae13
8
.github/workflows/delete-old-releases.yml
vendored
8
.github/workflows/delete-old-releases.yml
vendored
|
@ -22,6 +22,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
# Define the threshold date (1 month ago)
|
# Define the threshold date (1 month ago)
|
||||||
THRESHOLD_DATE=$(date -d "1 month ago" +%Y-%m-%dT%H:%M:%SZ)
|
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)
|
# 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")
|
ALL_RELEASES=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases?per_page=100&page=1")
|
||||||
|
@ -38,6 +41,11 @@ jobs:
|
||||||
if [ "$RELEASE_ID" == "$LATEST_RELEASE" ]; then
|
if [ "$RELEASE_ID" == "$LATEST_RELEASE" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
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
|
# 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")
|
OLD_RELEASES=$(echo "$ALL_RELEASES" | jq --arg threshold "$THRESHOLD_DATE" ".[$i] | select(.published_at < \$threshold) | .id")
|
||||||
|
|
Loading…
Reference in a new issue