Skip to content

Commit

Permalink
shellcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Valdes <[email protected]>
  • Loading branch information
ivanvc committed Sep 26, 2024
1 parent d03a116 commit b1e4b87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,18 @@ main() {
exit 1
fi

# Disable shellcheck SC2016, the single quoted syntax for sed is intentional.
# shellcheck disable=SC2016
local gh_repo
if [ "${REPO}" = "$(pwd)" ]; then
gh_repo=$(git remote get-url origin)
else
gh_repo="${REPO}"
fi

gh_repo=$(echo "${gh_repo}" | sed 's/^[^@]\+@//' | sed 's/https\?:\/\///' | sed 's/\.git$//' | tr ':' '/')
log_callout "Creating GitHub release for ${RELEASE_VERSION} on ${gh_repo}"

# Disable sellcheck SC2016, the single quoted syntax for sed is intentional.
# shellcheck disable=SC2016
run sed 's/${RELEASE_VERSION}/'"${RELEASE_VERSION}"'/' ./scripts/release_notes.tpl.txt | \
gh release create "${RELEASE_VERSION}" \
--repo "${gh_repo}" \
Expand All @@ -352,7 +353,8 @@ main() {

run find ./release '(' -name '*.tar.gz' -o -name '*.zip' ')' -exec \
gh --repo "${gh_repo}" release upload "${RELEASE_VERSION}" {} \;
local release_url=$(gh --repo "${gh_repo}" release view ${RELEASE_VERSION} --json url --jq '.url')
local release_url
release_url=$(gh --repo "${gh_repo}" release view "${RELEASE_VERSION}" --json url --jq '.url')

log_warning ""
log_warning "WARNING: The GitHub release for ${RELEASE_VERSION} has been created as a draft, please go to ${release_url} and release it."
Expand Down

0 comments on commit b1e4b87

Please sign in to comment.