Skip to content

Commit fad2c14

Browse files
authored
ci: fix dev-build GitHub Releases to reference most recent commit in full changelog (#8)
1 parent a1ee7f9 commit fad2c14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ jobs:
313313
echo "Overwriting existing GitHub Release data; generating pre-release notes ..."
314314
LAST_SEMVER_TAG=$(git describe --tags --match 'v*.*.*' --abbrev=0 | cut -d"-" -f1)
315315
# When generating release notes, setting the target tag_name property to an existing tag has GitHub ignore the target_commitish property
316-
# So, set it to some non-existent tag name for release-note-generating purposes.
316+
# So, set the tag name to the target commit to generate release notes from the last semver tag to the target commit
317317
# See https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release--parameters
318318
# Note the following _does not change releases or tags_ - it only creates release notes, just like clicking "Generate Release Notes" on the GitHub Releases page.
319-
CHANGELOG=$(curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_RELEASE_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/slackapi/slack-cli/releases/generate-notes -d "{\"tag_name\":\"does-not-exist\",\"target_commitish\":\"${TARGET}\",\"previous_tag_name\":\"${LAST_SEMVER_TAG}\"}" | jq .body)
319+
CHANGELOG=$(curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_RELEASE_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/slackapi/slack-cli/releases/generate-notes -d "{\"tag_name\":\"${TARGET}\",\"target_commitish\":\"${TARGET}\",\"previous_tag_name\":\"${LAST_SEMVER_TAG}\"}" | jq .body)
320320
echo "Will use release notes: ${CHANGELOG}"
321321
BODY+="\"body\":$CHANGELOG}"
322322
echo "Updating existing GitHub pre-release ${RELEASE_ID} with ${BODY}"

0 commit comments

Comments
 (0)