Skip to content

Commit

Permalink
CI script, adding CI_FAILURE_NOTIFICATION_DISABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-brandizi committed Mar 25, 2024
1 parent 6b304de commit e19f11f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ci-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set -e
#
function notify_failure
{
if [[ ! "${CI_FAILURE_NOTIFICATION_DISABLED}" == true ]]; then
printf "\n CI_FAILURE_NOTIFICATION_DISABLED is set, no failure notification sent"
return 1
fi

run_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
if [[ -z "$CI_FAIL_MESSAGE" ]]; then
# Slack uses a reduced version of MD (https://api.slack.com/reference/surfaces/formatting)
Expand All @@ -14,7 +19,7 @@ function notify_failure

if [[ -z "$CI_SLACK_API_NOTIFICATION_URL" ]]; then
printf "\n\nERROR: can't send error notification to empty Slack URL\n\n"
exit 1
return 1
fi

curl -X POST -H 'Content-type: application/json' \
Expand Down

0 comments on commit e19f11f

Please sign in to comment.