So far, all the work we have performed at GitHub has been manual. Programmers like to automate processes, and performing GitHub work is no exception to that rule. With the next recipe, we will show you how you can automate tasks.
To automate GitHub tasks you need to be able to access GitHub. Instead of logging in using a user name and password, you can use an API key or personal access token. Such a token should not be shared, and you need to keep it secret at all times.
So, this recipe begins with generating an access token and shows you a simple Python script. The Python script will find all your repositories, and find all the pull requests for each repository.
- First, we need to generate the personal access token. You will have to drill down in the menu system:
Settings
,Developer settings
, and finally,Person access token
. We will give our token the namebasic-query
since we plan only to do that. You can specify what the token has access...