zpnk / stage-ci

Automatic deploy previews for your PRs using zeit.co/now.
https://stage.now.sh
MIT License
131 stars 23 forks source link

Support for GitHub Organizations #20

Open eugeneross opened 7 years ago

eugeneross commented 7 years ago

Would like to see this able to support repos within an organization. I would love to use this at my company. I originally tried to do this for an organization, but to the best of my knowledge organizations and their repos don't have auth tokens. Would there be a way to use stage through a web hook instead?

zpnk commented 7 years ago

We do use web hooks, but the reason we need the auth token is to actually clone the repo so we can deploy it.

The way it works is: GitHub sends an event via webhook -> stage clones the latest commit for the repo -> stage deploys the repo at that commit.

To handle this The Right Way™ would mean moving away from the personal access tokens and implementing the OAuth flow.

Users could sign in with GitHub the we'd generate the token for them and hand it off to stage-ci. Implementing this flow would require work on the stage.now site.

I'd love to move in that direction, but it's definitely a larger project. I'm definitely open to PRs on that front!

eugeneross commented 7 years ago

Thanks for the clarification! I'll look into providing a PR somehow!