File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,22 @@ jobs:
1717 GH_TOKEN : ${{ github.token }}
1818 shell : bash
1919 run : |
20+ # Escape tags to create a semantic version
21+ REF=$(echo "${{ github.event.ref }}" | sed 's/\//-/g')
22+ RELEASE_FOUND=1
23+
24+ # Delete tags matching the pull request branch from forks
25+ if GH_DEBUG=1 gh release --repo="slackapi/slack-cli" delete "${REF}" -y --cleanup-tag; then
26+ echo "Successfully deleted ${REF}"
27+ RELEASE_FOUND=0
28+ else
29+ echo "Did not find ${REF} tag, trying version prefixes..."
30+ fi
31+
2032 # 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.
2133 RELEASES=$(gh release list --repo="slackapi/slack-cli" --order="desc" --json="tagName" --exclude-drafts --exclude-pre-releases --limit=24 --jq ".[] | .tagName")
22- RELEASE_FOUND=1
2334 for TAGS in $RELEASES; do
24- TAG_NAME="${TAGS}-${{ github.event.ref } }"
35+ TAG_NAME="${TAGS}-${REF }"
2536 echo "Identified pre-release tagname to 🔪: $TAG_NAME"
2637
2738 # Delete the pre-release
You can’t perform that action at this time.
0 commit comments