Skip to content

Commit f847d28

Browse files
authored
ci: fix and enable post-release notification (#6613)
- Enable for prod runs - Fix script slightly because the way codebuild runs bash and the way my local runs bash seems to not be the same. - Tested on dev release pipeline --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 46d76cb commit f847d28

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

buildspec/release/80notify.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ phases:
1414
build:
1515
commands:
1616
- echo "TARGET_EXTENSION=${TARGET_EXTENSION}"
17-
- EXTENSION_NAME=$([ "$TARGET_EXTENSION" = "amazonq" ] && echo "Amazon Q" || echo "AWS Toolkit")
18-
- VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
19-
- CHANGELOG=$(cat packages/${TARGET_EXTENSION}/CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print if $. == 2')
20-
- MESSAGE=$(envsubst < "$GITHUB_WORKSPACE/buildspec/release/notify.txt")
21-
- DATA="{'Content':'${MESSAGE}'}"
17+
- export EXTENSION_NAME=$([ "$TARGET_EXTENSION" = "amazonq" ] && echo "Amazon Q" || echo "AWS Toolkit")
18+
- export VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
19+
- export CHANGELOG=$(cat packages/${TARGET_EXTENSION}/CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print if $. == 2')
20+
- MESSAGE=$(envsubst < ./buildspec/release/notify.txt)
2221
- |
23-
# TODO: Enable for prod only after testing
24-
if [ "$STAGE" = "prod" ]; then
25-
echo "SKIPPED (stage=${STAGE}): 'curl -v POST \"[SLACK_URL]\" -H \"Content-Type:application/json\" --data $DATA'"
22+
if [ "$STAGE" != "prod" ]; then
23+
echo "SKIPPED (stage=${STAGE}): 'curl -v POST \"[NOTIFY_URL]\" -H \"Content-Type:application/json\" --data \"{\"Content\":\"${MESSAGE}\"}\"'"
2624
exit 0
2725
fi
28-
curl -v POST "${NOTIFY_URL}" -H "Content-Type:application/json" --data $DATA
26+
curl -v POST "${NOTIFY_URL}" -H "Content-Type:application/json" --data "{\"Content\":\"${MESSAGE}\"}"

0 commit comments

Comments
 (0)