Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRAVIS_TAG could set canpush without checking all rules #347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterjc
Copy link

@peterjc peterjc commented Jun 14, 2019

If $TRAVIS_TAG and --build-tags are set, then we get canpush=True without checking all rules, e.g. If the repository was a fork, then the push should be prevented.

As an aside, I noticed this edge can while looking at issue #342 (there are legitimate cases where it is reasonable to want to push from a forked repository).

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.
@asmeurer
Copy link
Member

Looks like the doctr tests don't even pass on fork builds. I need to finish #343.

@asmeurer
Copy link
Member

Oh actually I think that test failure is legitimate. It's a test for this function. So it should be updated.

I think I never considered the fact that someone would push a tag to their fork, but this looks correct.

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]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is TRAVIS_BRANCH set to when TRAVIS_TAG is true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants