File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
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
6765 gh release delete "$TAG" \
6866 --yes \
6967 --cleanup-tag
70- done <<EOF
71- $RELEASE_TAGS
72- EOF
68+ done
You can’t perform that action at this time.
0 commit comments