Skip to content

Commit

Permalink
fix(plugins/github-release): use gh cli and extended chars limit trick
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Apr 27, 2024
1 parent 5252c36 commit e5717c1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ release() {
log_verbose "GitHub release hash: $CHECKOUT_SHA!"

if ! $IS_DRY_RUN; then
curl -s -o /dev/null \
-L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$GIT_REPO_NAME/releases" \
-d "{\"tag_name\":\"$NEXT_RELEASE_TAG\",\"name\":\"$NEXT_RELEASE_TAG\",\"body\":\"$RELEASE_BODY\",\"draft\":false,\"prerelease\":$PRE_RELEASE_VERSION,\"generate_release_notes\":false,\"make_latest\":\"true\"}"
log "Created GitHub release [$NEXT_RELEASE_TAG]!"
log "GitHub release available at https://github.com/$GIT_REPO_NAME/releases/tag/$NEXT_RELEASE_TAG"
if ! command -v gh; then
echo "GitHub CLI not found your machine"
return 1
fi

if $PRE_RELEASE_VERSION; then
printf "%b" "${RELEASE_BODY-}" | gh release create "${NEXT_RELEASE_TAG-}" --title "${NEXT_RELEASE_TAG-}" --prerelease --notes-file -
else
printf "%b" "${RELEASE_BODY-}" | gh release create "${NEXT_RELEASE_TAG-}" --title "${NEXT_RELEASE_TAG-}" --latest --notes-file -
fi
else
log "Skipped GitHub release [$NEXT_RELEASE_TAG] in DRY-RUN mode."
fi
Expand Down

0 comments on commit e5717c1

Please sign in to comment.