Skip to content

Commit fe3ac05

Browse files
fail action if cdk subcommand exits with non-zero exit code
1 parent b8e9f11 commit fe3ac05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ function runCdk(){
6868
echo "${output}"
6969

7070
commentStatus="Failed"
71-
if [ "${exitCode}" == "0" -o "${exitCode}" == "1" ]; then
71+
if [ "${exitCode}" == "0" ]; then
7272
commentStatus="Success"
73+
elif [ "${exitCode}" != "0" ]; then
74+
echo "CDK subcommand ${INPUT_CDK_SUBCOMMAND} for stack ${INPUT_CDK_STACK} has failed. See above console output for more details."
75+
exit 1
7376
fi
7477

7578
if [ "$GITHUB_EVENT_NAME" == "pull_request" ] && [ "${INPUT_ACTIONS_COMMENT}" == "true" ]; then

0 commit comments

Comments
 (0)