Skip to content
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ commands:
- run:
name: Output BUILD_VERSION env var based on recent git tag and type of build
command: |
BUILD_VERSION=$(git describe --tags --match 'v*.*.*' --exclude '*feature');
BUILD_VERSION=$(git describe --tags --match 'v*.*.*');
echo "git tag-based BUILD_VERSION: $BUILD_VERSION"
if [[ "<< parameters.release_ref >>" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
# if release tag starts with semver, then this is either a prod or feature build. use the release tag, then, as build version too.
Expand Down Expand Up @@ -313,10 +313,10 @@ jobs:
echo "Overwriting existing GitHub Release data; generating pre-release notes ..."
LAST_SEMVER_TAG=$(git describe --tags --match 'v*.*.*' --abbrev=0 | cut -d"-" -f1)
# When generating release notes, setting the target tag_name property to an existing tag has GitHub ignore the target_commitish property
# So, set it to some non-existent tag name for release-note-generating purposes.
# So, set the tag to the commit hash for release-note-generating purposes.
# See https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release--parameters
# 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.
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)
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)
echo "Will use release notes: ${CHANGELOG}"
BODY+="\"body\":$CHANGELOG}"
echo "Updating existing GitHub pre-release ${RELEASE_ID} with ${BODY}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -eo

# USAGE:
# ./scripts/archive.sh <artifact path> <release version>
Expand Down
Loading