File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1818 shell : bash
1919 run : |
2020 # Figure out tag name from branch name. This is coupled to the tag name generation that exists in .circleci/config.yml's `create-github-release` job.
21- LATEST_RELEASE_TAG=$(gh release list --repo slackapi/slack-cli --json tagName,isLatest --jq ".[] | select(.isLatest == true) | .tagName" )
22- TAG_NAME="$LATEST_RELEASE_TAG-${{ github.event.ref }}"
23- echo "Identified pre-release tagname to 🔪: $TAG_NAME"
24- # Delete the pre-release
25- GH_DEBUG=1 gh release --repo slackapi/slack-cli delete $TAG_NAME -y --cleanup-tag
21+ RELEASES=$(gh release list --repo="slackapi/slack-cli" --order="desc" --json="tagName" --exclude-drafts --exclude-pre-releases --limit=24 --jq ".[] | .tagName")
22+ for TAGS in $RELEASES; do
23+ TAG_NAME="${TAGS}-${{ github.event.ref }}"
24+ echo "Identified pre-release tagname to 🔪: $TAG_NAME"
25+
26+ # Delete the pre-release
27+ if GH_DEBUG=1 gh release --repo="slackapi/slack-cli" delete "$TAG_NAME" -y --cleanup-tag; then
28+ echo "Successfully deleted $TAG_NAME"
29+ exit 0
30+ else
31+ echo "Failed to find $TAG_NAME, trying next..."
32+ fi
33+ done
34+ echo "No matching pre-releases tag was found for the branch $TAG_NAME in recent versions"
35+ exit 1
You can’t perform that action at this time.
0 commit comments