Skip to content

Skip useless notify jobs

Baodong请求将fix/skip-useless-notify-jobs合并到main-jh

What does this MR do and why?

Skip useless notify jobs

Job case: https://jihulab.com/gitlab-cn/gitlab/-/jobs/6258748

Reference code:

.gitlab/ci/notify.gitlab-ci.yml

script:
    - |
      if [[ "${CREATE_INCIDENT_FOR_PIPELINE_FAILURE}" == "true" ]]; then
        scripts/create-pipeline-failure-incident.rb -p ${INCIDENT_PROJECT} -f ${INCIDENT_JSON} -t ${BROKEN_BRANCH_PROJECT_TOKEN};
        echosuccess "Created incident $(jq '.web_url' ${INCIDENT_JSON})";
      fi
    - |
      scripts/generate-failed-pipeline-slack-message.rb -i ${INCIDENT_JSON} -f ${FAILED_PIPELINE_SLACK_MESSAGE_FILE};
      curl -X POST -H 'Content-Type: application/json' --data @${FAILED_PIPELINE_SLACK_MESSAGE_FILE} "$CI_SLACK_WEBHOOK_URL" ||
        scripts/slack ${SLACK_CHANNEL} "☠️  Broken pipeline notification failed! ☠️  See ${CI_JOB_URL}" ci_failing "Failed pipeline reporter"

合并请求报告

加载中