Skip to content

Interacting with GitHub

brianmoose edited this page Dec 7, 2016 · 5 revisions

These are the details on how to get CIVET to interact with GitHub.

OAuth Application

You will need to create a OAuth application on GitHub. This can be done under <user icon> -> Settings -> OAuth applications. This should be created by a user that will be trusted by all repositories that CIVET will handle. When a user logs into CIVET, they will be asked to trust this application. Every user that will be responsible for recipes ( build_user in a recipe ) needs to log into CIVET and trust the application. This allows CIVET to make requests to GitHub on behalf of the user. Other users do not necessarily need to trust this application to see and use CIVET.

When you create the OAuth application it will ask for an Authorization callback URL. This should be set to WEBHOOK_BASE_URL/github/callback where WEBHOOK_BASE_URL is set in civet/settings.py. It will give you a Client ID and a Client Secret. These should be copied into civet/settings.py GITHUB_CLIENT_ID and GITHUB_SECRET_ID respectively. The Client Secret should be kept secret and you should be careful not to commit this to the repository if it is publicly accessible.

Collaboration

CIVET can work with any number of repositories owned by any user. To do this it is required that the user that handles the recipe (build_user in a recipe) is a collaborator on the repository. To add a user as a collaborator on a repository, go to Settings -> Collaborators on the repository. Enter the user name in the box and press the Add collaborator button. This will send a link to the user that they will have to accept.

See Setting up a GitHub repository to be tested

Clone this wiki locally