Using the VuePilot GitHub app requires you to generate an access token that we then use to call the GitHub app on your behalf and retrieve repository information to generate the dashboard.
The GitHub API does not provide a READ ONLY endpoint and so it is highly recommended that you create a separate GitHub service account and a RESTRICTED GitHub team then assign your repository to this group with only READ permissions.
Essentially we will create a service user then grant this user READ access to the repo from an organisation administrators account.
We will then generate an access token, for the service users account that has REPO permissions, although as the organisation restricts this service user as READ ONLY this limits the users permission at the organisation level.
Here’s how to get up and running
Step 1: Create The Service Account
First up, create a new GitHub user account. Give it a name that indicates it’s a service account. For example “company_vuepilot_svc“. We will only be using this account for its access token and restricting its permissions.
Step 2: Grant The User READ ONLY Rights To The Repo
This can either be done by creating a team and assigning the repository to the team with READ permissions, then assigning the Service Account user we created above to the team, see:
Managing team access to an organization repository
or you can grant the individual user READ permission by following these steps
Managing an individual’s access to an organization repository
Step 3: Generate The Personal Access Token
Next we need to generate the access token that we will use to create the app.
When logged in to the service accounts GitHub page, follow the steps found in the article below to generate a new token
Creating a personal access token
You must select only the top level box at the repo level of the permission screen. For example
Please Note: The VuePilot GitHub app only performs GET requests on the https://api.github.com/repos/pulls & https://api.github.com/repos/commits/status API endpoint, however when you uncheck any of these other boxes we lose permission to query for pull request status. This seems to be a limitation of the GitHub API which is why we create the READ ONLY grouping above
Step 4: Create The GitHub Pull Request Dashboard App
Now we’re ready to create the app, simply visit the VuePilot Apps section on the dashboard and create a new GitHub app.
Enter in your user access token that we generated above
Once you save the app, the access token will not be visible on this form again. You can still update the token at any time by entering a new one and clicking save.
Then enter your organisation name (owner name) and the repo name.
For example, the the URL to your repo is: https://github.com/microsoft/TypeScript then the owner name is “microsoft” and the repo name is “TypeScript“.
Click save and you’re done. You can now preview the dashboard and assign to your screens