Skip to content

Commit 75fd7fa

Browse files
committed
CI: Modify notification steps to be silent in PRs
1 parent f095442 commit 75fd7fa

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.circleci/config.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ orbs:
3131
win: circleci/[email protected]
3232

3333
commands:
34-
gitter_notify:
34+
gitter_notify_unless_pr:
3535
description: "Posts a notification to the main room on Gitter (if not running on a PR)."
3636
parameters:
3737
event:
@@ -44,6 +44,8 @@ commands:
4444
name: "Gitter notification"
4545
when: << parameters.condition >>
4646
command: |
47+
[[ $CI_PULL_REQUEST == "" ]] || { echo "Running on a PR - notification skipped."; exit 0; }
48+
4749
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ Nightly job **${CIRCLE_JOB}** failed on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
4850
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ Nightly job **${CIRCLE_JOB}** succeeded on **${CIRCLE_BRANCH}**. Please see [build #${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
4951
@@ -55,17 +57,17 @@ commands:
5557
--header "Authorization: Bearer ${GITTER_API_TOKEN}" \
5658
--data "{\"text\":\"${message}\"}"
5759
58-
gitter_notify_failure:
60+
gitter_notify_failure_unless_pr:
5961
description: "Posts a failure notification to the main room on Gitter (if not running on a PR)."
6062
steps:
61-
- gitter_notify:
63+
- gitter_notify_unless_pr:
6264
event: failure
6365
condition: on_fail
6466

65-
gitter_notify_success:
67+
gitter_notify_success_unless_pr:
6668
description: "Posts a success notification to the main room on Gitter (if not running on a PR)."
6769
steps:
68-
- gitter_notify:
70+
- gitter_notify_unless_pr:
6971
event: success
7072
condition: on_success
7173

@@ -562,9 +564,9 @@ jobs:
562564
steps:
563565
- checkout
564566
- run: *run_build
565-
- gitter_notify_failure
566567
- store_artifacts: *artifacts_solc
567568
- persist_to_workspace: *artifacts_executables
569+
- gitter_notify_failure_unless_pr
568570

569571
b_ubu_release: &b_ubu_release
570572
<<: *b_ubu
@@ -650,10 +652,10 @@ jobs:
650652
git clone https://github.com/ethereum/solidity-fuzzing-corpus /tmp/solidity-fuzzing-corpus
651653
mkdir -p test_results
652654
scripts/regressions.py -o test_results
653-
- gitter_notify_failure
654-
- gitter_notify_success
655655
- store_test_results: *store_test_results
656656
- store_artifacts: *artifacts_test_results
657+
- gitter_notify_failure_unless_pr
658+
- gitter_notify_success_unless_pr
657659

658660
b_archlinux:
659661
<<: *base_archlinux
@@ -852,15 +854,15 @@ jobs:
852854
- when:
853855
condition: true
854856
<<: *steps_soltest
855-
- gitter_notify_failure
857+
- gitter_notify_failure_unless_pr
856858

857859
t_ubu_ubsan_clang_cli:
858860
<<: *base_ubuntu2004_clang
859861
steps:
860862
- when:
861863
condition: true
862864
<<: *steps_cmdline_tests
863-
- gitter_notify_failure
865+
- gitter_notify_failure_unless_pr
864866

865867
t_ems_solcjs:
866868
<<: *base_ubuntu2004
@@ -940,8 +942,8 @@ jobs:
940942
- when:
941943
condition: <<parameters.gitter_notify>>
942944
steps:
943-
- gitter_notify_failure
944-
- gitter_notify_success
945+
- gitter_notify_failure_unless_pr
946+
- gitter_notify_success_unless_pr
945947

946948
b_win: &b_win
947949
<<: *base_win_powershell

0 commit comments

Comments
 (0)