GitHub
Reads and comments on issues, opens pull requests, pushes code work
- You make
- a fine-grained personal access token
- Where
- https://github.com/settings/personal-access-tokens/new
- Command
kokuban connect github --account <owner/repo>
Steps
- Name it kokuban and pick when it ends (90 days is fine)
- Repository access: Only select repositories, and pick the ones kokuban works on
- Repository permissions: Issues, Pull requests and Contents: Read and writeContents lets kokuban push the branches of its code work. Leave it out if you only want issues and comments.
- Generate the token and copy it (github_pat_…)The token is shown once. If you lose it, make a new one.
Then connect it
kokuban connect github --account <owner/repo>kokuban asks for the key (it is not shown as you paste it), keeps it in your OS keychain, and tries it at once. If the key cannot do something, it says what to change.
On kokuban's screen, the connections list shows the services not connected yet: open one and press y, and the screen hands the terminal to this command.
Good to know
- Already signed in with the GitHub CLI (gh auth login)? kokuban connect github --from-gh uses that sign-in instead. It can do whatever your sign-in can, so give --account owner/repo to keep it to one repository.
- --account owner/repo keeps the connection to that repository; --account owner to that owner's repositories.
- A repository of an organization may ask the organization to approve the token first.
If it does not work
On the token's page, give Issues, Pull requests and Contents: Read and write, for this repository
kokuban connections checks every connection and says which ones need you.
Taking it back
Run kokuban disconnect github@hq (or @your company), then delete the token on GitHub: Settings, Developer settings, Personal access tokens, Fine-grained tokens.