Skip to content

Commit f7cc1a9

Browse files
DvirDukhanswilly22
authored andcommitted
stop forked PR to use secrets (#55)
1 parent 13d1534 commit f7cc1a9

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.circleci/config.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22
#
33
# Check https://circleci.com/docs/2.0/language-python/ for more details
44
#
5-
version: 2
5+
version: 2.1
6+
commands:
7+
early_return_for_forked_pull_requests:
8+
description: >-
9+
If this build is from a fork, stop executing the current job and return success.
10+
This is useful to avoid steps that will fail due to missing credentials.
11+
steps:
12+
- run:
13+
name: Early return if this build is from a forked PR
14+
command: |
15+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
16+
echo "Nothing to do for forked PRs, so marking this step successful"
17+
circleci step halt
18+
fi
619
jobs:
720
build:
821
docker:
922
- image: circleci/python:3.6.1
1023

1124
- image: redislabs/redisgraph:edge
12-
port: 6379:6379
1325

1426
working_directory: ~/repo
1527

@@ -41,8 +53,15 @@ jobs:
4153
command: |
4254
. venv/bin/activate
4355
coverage run test.py
44-
codecov
45-
56+
57+
- early_return_for_forked_pull_requests
58+
59+
- run:
60+
name: codecove
61+
command: |
62+
. venv/bin/activate
63+
codecov
64+
4665
# - store_artifacts:
4766
# path: test-reports
4867
# destination: test-reports

0 commit comments

Comments
 (0)