Skip to content

Commit 5325c78

Browse files
committed
Ensure Snyk only runs if $SNYK_TOKEN exists
1 parent 236117e commit 5325c78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ before_install:
3535
- sudo ldconfig
3636
- cd ..
3737
- pip install -e git+https://github.com/maxmind/MaxMind-DB-Reader-python#egg=maxminddb
38-
- "if [[ $RUN_SNYK ]]; then sudo apt-get install -y nodejs; npm install -g snyk; fi"
38+
- "if [[ $RUN_SNYK && $SNYK_TOKEN ]]; then sudo apt-get install -y nodejs; npm install -g snyk; fi"
3939
install:
4040
- pip install -r requirements.txt
4141
- pip install requests_mock pylint coveralls yapf
42-
- "if [[ $RUN_SNYK ]]; then snyk test --org=maxmind; fi"
42+
- "if [[ $RUN_SNYK && $SNYK_TOKEN ]]; then snyk test --org=maxmind; fi"
4343
script:
4444
- coverage run --source=geoip2 setup.py test
4545
- "if [[ $RUN_LINTER ]]; then ./.travis-pylint.sh; fi"
4646
- "if [[ $RUN_LINTER ]]; then ./.travis-yapf.sh; fi"
4747
after_success:
4848
- coveralls
49-
- "if [[ $RUN_SNYK && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then snyk monitor --org=maxmind --project-name=maxmind/GeoIP2-python; fi"
49+
- "if [[ $RUN_SNYK && $SNYK_TOKEN && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then snyk monitor --org=maxmind --project-name=maxmind/GeoIP2-python; fi"
5050
notifications:
5151
email:
5252
on_failure: always

0 commit comments

Comments
 (0)