Skip to content

Commit 9f0cd31

Browse files
committed
update on release cleanup
1 parent b4b987d commit 9f0cd31

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

.github/workflows/cleanup-temp-releases.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,17 @@ jobs:
3434
echo "Merged branch: $BRANCH_NAME"
3535
echo "Safe branch: $SAFE_BRANCH"
3636
37-
- name: Delete temporary releases and tags for merged branch
37+
- name: Delete all temporary releases and tags for merged branch
3838
run: |
3939
PREFIX="temp-${SAFE_BRANCH}-v"
4040
4141
echo "Looking for releases with prefix: $PREFIX"
4242
4343
RELEASE_TAGS="$(
44-
gh api \
45-
--paginate \
46-
"repos/${GITHUB_REPOSITORY}/releases" \
47-
--jq '.[].tag_name' \
48-
| grep -E "^${PREFIX}[0-9]+$" \
49-
|| true
44+
gh release list \
45+
--limit 1000 \
46+
--json tagName \
47+
--jq '.[] | .tagName | select(test("^'"${PREFIX}"'[0-9]+$"))'
5048
)"
5149
5250
if [ -z "$RELEASE_TAGS" ]; then
@@ -57,7 +55,7 @@ jobs:
5755
echo "Found temporary releases:"
5856
echo "$RELEASE_TAGS"
5957
60-
while IFS= read -r TAG; do
58+
echo "$RELEASE_TAGS" | while IFS= read -r TAG; do
6159
if [ -z "$TAG" ]; then
6260
continue
6361
fi
@@ -67,6 +65,4 @@ jobs:
6765
gh release delete "$TAG" \
6866
--yes \
6967
--cleanup-tag
70-
done <<EOF
71-
$RELEASE_TAGS
72-
EOF
68+
done

0 commit comments

Comments
 (0)