Skip to content

Commit 175271e

Browse files
committed
ci: Skip Coveralls submission if COVERALLS_REPO_TOKEN env. var is empty
1 parent cc017ff commit 175271e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.circleci/config.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ job-tmpl: &job-tmpl
118118
coverage report
119119
pip install urllib3[secure]
120120
pip install coveralls
121-
CIRCLE_BUILD_NUM=$CIRCLE_WORKFLOW_ID coveralls
121+
if [[ "$COVERALLS_REPO_TOKEN" != "" ]]; then
122+
CIRCLE_BUILD_NUM=$CIRCLE_WORKFLOW_ID coveralls
123+
else
124+
echo "Skipping Coveralls"
125+
fi
122126
123127
- store_test_results:
124128
path: junit
@@ -159,7 +163,12 @@ jobs:
159163
steps:
160164
- run:
161165
name: Complete Coveralls
162-
command: curl --fail https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_ID&payload[status]=done"
166+
command: |
167+
if [[ "$COVERALLS_REPO_TOKEN" != "" ]]; then
168+
curl --fail https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_ID&payload[status]=done"
169+
else
170+
echo "Skipping Coveralls"
171+
fi
163172
164173
workflows:
165174
version: 2

0 commit comments

Comments
 (0)