diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index 72dbb64439576d1799de8289e9e81b72dfb3138a..4f51409d6a83d3ceaa71f7e898dd3e47ab1c7716 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -85,12 +85,13 @@ danger-review: - bundle_install_script "--with danger" - run_timed_command "retry yarn install --frozen-lockfile" script: + # ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml - > if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then run_timed_command danger_as_local else danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10) - run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=${danger_id}" + run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\"" fi danger-review-local: diff --git a/scripts/utils.sh b/scripts/utils.sh index 335b2eb41e7c6bbd3c0882a1ed117c016c5e3a59..8db525abc933be4bf1b4cee3f048c22d81a36d5a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -181,5 +181,5 @@ function danger_as_local() { # Force danger to skip CI source GitLab and fallback to "local only git repo". unset GITLAB_CI # We need to base SHA to help danger determine the base commit for this shallow clone. - bundle exec danger dry_run --fail-on-errors=true --verbose --base="${CI_MERGE_REQUEST_DIFF_BASE_SHA}" --head="${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-$CI_COMMIT_SHA}" + bundle exec danger dry_run --fail-on-errors=true --verbose --base="${CI_MERGE_REQUEST_DIFF_BASE_SHA}" --head="${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-$CI_COMMIT_SHA}" --dangerfile="${DANGER_DANGERFILE:-Dangerfile}" }