Skip to content

Commit

Permalink
chore: improve release detection
Browse files Browse the repository at this point in the history
As suggested here: cli/cli#6964 (comment)
  • Loading branch information
felipecrs committed Feb 6, 2023
1 parent 6d4233e commit 30d9443
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ set -o nounset

TAG="${TAG?}"

# First delete if release is there already
# https://github.com/cli/cli/issues/6964
output=$(gh release delete "${TAG}" --cleanup-tag --yes 2>&1) || [[ "${output}" == "release not found" ]]
echo "${output}"
# Delete the release if it already exists
if gh release view "${TAG}" &>/dev/null; then
gh release delete "${TAG}" --cleanup-tag --yes 2>&1
fi

gh release create "${TAG}" --title "${TAG}" --target main --latest=false \
--notes "The original release notes can be found [here](https://github.com/koalaman/shellcheck/releases/tag/${TAG})." \
Expand Down

0 comments on commit 30d9443

Please sign in to comment.