From 64c4a8584c7d496db29c4513ebbb764fbd6ad8e3 Mon Sep 17 00:00:00 2001
From: Peter Cock
Date: Sat, 15 Jun 2019 00:52:05 +0100
Subject: [PATCH] TRAVIS_TAG could set canpush without checking all rules
e.g. If the repository was a fork, then the push should be prevented - even if the build is for a tag and --build-tags is set.
---
doctr/travis.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/doctr/travis.py b/doctr/travis.py
index 0f15eca5..e81b5a3c 100644
--- a/doctr/travis.py
+++ b/doctr/travis.py
@@ -575,10 +575,9 @@ def determine_push_rights(*, branch_whitelist, TRAVIS_BRANCH,
"""
canpush = True
- if TRAVIS_TAG:
- if not build_tags:
- print("The docs are not pushed on tag builds. To push on future tag builds, use --build-tags")
- return build_tags
+ if TRAVIS_TAG and not build_tags:
+ print("The docs are not pushed on tag builds. To push on future tag builds, use --build-tags")
+ canpush = False
if not any([re.compile(x).match(TRAVIS_BRANCH) for x in branch_whitelist]):
print("The docs are only pushed to gh-pages from master. To allow pushing from "