Skip to content

Commit 56d2a4b

Browse files
authored
Avoid granting the possibility to push on the repo for pull requests
Pull requests sent from forked repositories do not have access to encrypted variables or data. https://docs.travis-ci.com/user/pull-requests/
1 parent 61c10ba commit 56d2a4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ after_success:
5858
- pylint mini_lambda # note that at the moment the report is simply lost, we dont transform the result into anything
5959
# ***documentation***
6060
- mkdocs build -f docs/mkdocs.yml
61+
- if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then exit(0); fi;
6162
- mv reports/junit site/
6263
# mkdocs gh-deploy requires special care :
6364
# ---grant the possibility to push on the repo---
@@ -71,7 +72,7 @@ after_success:
7172
- git fetch gh-remote && git fetch gh-remote gh-pages:gh-pages;
7273
# push but only if this is not a build triggered by a pull request
7374
# note: here we use the --dirty flag so that mkdocs does not clean the additional reports that we copied in the site
74-
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; PYTHONPATH=mini_lambda/ mkdocs gh-deploy -v --dirty -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
75+
- if [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; PYTHONPATH=mini_lambda/ mkdocs gh-deploy -v --dirty -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
7576
# - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_PYTHON_VERSION}" = "3.5" ]; then echo "Pushing to github"; git push gh-remote gh-pages; fi;
7677

7778
deploy:

0 commit comments

Comments
 (0)