Skip to content

Commit

Permalink
CI: Workaround for $CIRCLE_PULL_REQUEST pointing at random PRs in run…
Browse files Browse the repository at this point in the history
…s outside of PRs
  • Loading branch information
cameel committed Nov 10, 2021
1 parent f42e3c0 commit 0ec3f52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ commands:
name: "Gitter notification"
when: << parameters.condition >>
command: |
[[ $CI_PULL_REQUEST == "" ]] || { echo "Running on a PR - notification skipped."; exit 0; }
# FIXME: Checking $CIRCLE_PULL_REQUEST would be better than hard-coding branch names
# but it's broken. CircleCI associates runs on develop/breaking with random old PRs.
[[ $CIRCLE_BRANCH == develop || $CIRCLE_BRANCH == breaking ]] || { echo "Running on a PR or a feature branch - notification skipped."; exit 0; }
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ Nightly job **${CIRCLE_JOB}** failed on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ Nightly job **${CIRCLE_JOB}** succeeded on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
Expand Down

0 comments on commit 0ec3f52

Please sign in to comment.