Recipe 1.14 Integrate Visual Studio Team Services (VSTS) with GitHub using a personal access token
Problem
You wish to integrate a GitHub repository with VSTS using a GitHub personal access token.
Solution
Note: If you're using a pop-up blocker, you'll need to allow your Team Services account to display pop-up windows.
Sign in to GitHub and make sure you have permission to read the repository.
In GitHub, create an access token.
- Select the repo, user, and admin:repo_hook scopes.
- Copy the token to your clipboard.
Sign on to Team Services and create a build definition.
On the Repository tab, next to the Connection drop-down, click the Manage link. The Services tab opens as a new tab in your browser.
- Click New Service Endpoint and choose GitHub.
- In the Add New GitHub Service Connection dialog box, select Personal access token.
- Paste the token and give the connection a name.
On theRepository tab, select the Connection you created.
Select the Repository that contains the code you want to build.