Skip to content

Commit 10be6f2

Browse files
author
DvirDukhan
committed
added forked PR stop before token usage
1 parent caa9c87 commit 10be6f2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.circleci/config.yml

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

1023
- image: redislabs/redisgraph:edge
11-
port: 6379:6379
1224

1325
working_directory: /go/src/github.com/RedisGraph/redisgraph-go
1426
steps:
1527
- checkout
1628
- run: go get -v -t -d ./...
1729
- run: go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
30+
- early_return_for_forked_pull_requests
1831
- run: bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}
1932

2033
workflows:

0 commit comments

Comments
 (0)