Skip to content

Commit

Permalink
removing CI_FAILURE_NOTIFICATION_DISABLED, just disable
Browse files Browse the repository at this point in the history
CI_SLACK_API_NOTIFICATION_URL in the workflow file.
  • Loading branch information
marco-brandizi committed Mar 26, 2024
1 parent 1b17060 commit 69a7a21
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ci-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ set -e
#
function notify_failure
{
# Useful when debugging
if [[ "${CI_FAILURE_NOTIFICATION_DISABLED}" == true ]]; then
printf "\n CI_FAILURE_NOTIFICATION_DISABLED is set, no failure notification sent"
if [[ -z "$CI_SLACK_API_NOTIFICATION_URL" ]]; then
printf "\n\nERROR: can't send error notification to empty Slack URL\n\n"
return 1
fi

Expand All @@ -18,11 +17,6 @@ function notify_failure
CI_FAIL_MESSAGE="$CI_FAIL_MESSAGE\n\nSorry, the build for this repo failed, see details <$run_url|here>.\n"
fi

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

curl -X POST -H 'Content-type: application/json' \
--data "{ \"text\": \"$CI_FAIL_MESSAGE\" }" \
"$CI_SLACK_API_NOTIFICATION_URL"
Expand Down

0 comments on commit 69a7a21

Please sign in to comment.