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

feature: restrict execution to branch #38

Open
boneskull opened this issue Aug 7, 2014 · 4 comments
Open

feature: restrict execution to branch #38

boneskull opened this issue Aug 7, 2014 · 4 comments

Comments

@boneskull
Copy link

You have two branches, master and foo. Both have the gh-pages task defined, but foo's is incorrect for whatever reason.

You run gh-pages while in foo. Whoops! The wrong files got deployed. Maybe you didn't notice.

I think most people will want to run gh-pages against master.

What about an option that, by default, says you cannot run the gh-pages task from any other branch than master? Then allow the user to provide an array of "allowed" branches if their use case differs.

@badboy
Copy link

badboy commented Mar 25, 2015

Yes! This just bitten me. Deploy should only ever happen on master.

@badboy
Copy link

badboy commented Mar 25, 2015

Now that I think about it (and after fixing my build) my first comment was a bit too fast.
The following travis config will prevent any deploys on non-master branches:

after_success:
  - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && grunt gh-pages

It might make sense to add a note to the Readme telling about this. :)

@boneskull
Copy link
Author

@badboy I didn't think of delegating the task to Travis. However, say I'm just running grunt gh-pages from the command-line.

@badboy
Copy link

badboy commented Mar 25, 2015

@boneskull: Yip, just wanted to mention that in my case it's possible to circumvent this through other means.

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

No branches or pull requests

2 participants