Skip to content

Commit

Permalink
ci: disable to send a report to coveralls from forked PRs (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
teppeis committed Apr 29, 2020
1 parent 8def82b commit 86550ae
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
version: 2.1

workflows:
version: 2
node-multi-build:
jobs:
- node-v10
- node-v12

version: 2
commands:
early_return_for_forked_pull_requests:
description: >-
If this build is from a fork, stop executing the current job and return success.
This is useful to avoid steps that will fail due to missing credentials.
See https://circleci.com/blog/continuous-deployment-of-an-express-graphql-server-to-heroku/
steps:
- run:
name: Early return if this build is from a forked PR
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
jobs:
node-base: &node-base
docker:
Expand All @@ -31,6 +47,11 @@ jobs:
CLOSURE_VER=20190325
npm i "google-closure-deps@${CLOSURE_VER}"
npm run unit
- save_cache:
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
paths:
- ~/.npm
- early_return_for_forked_pull_requests
- run:
name: Report coverage to coveralls.io
command: |
Expand All @@ -39,10 +60,6 @@ jobs:
else
echo "Skip reporting coverage"
fi
- save_cache:
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
paths:
- ~/.npm
node-v10:
<<: *node-base
Expand Down

0 comments on commit 86550ae

Please sign in to comment.