Skip to content

Commit

Permalink
docs: update token section in bot README (gnolang#3261)
Browse files Browse the repository at this point in the history
Simple update of the bot README to mention the necessary permissions for
the bot to operate, see this comment:
gnolang#3238 (comment)

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
</details>
  • Loading branch information
aeddi authored and r3v4s committed Dec 10, 2024
1 parent 2ba48a4 commit 9156613
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions contribs/github-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,24 @@ The bot configuration is defined in Go and is located in the file [config.go](./

For the bot to make requests to the GitHub API, it needs a Personal Access Token. The fine-grained permissions to assign to the token for the bot to function are:

#### Repository permissions

- `pull_requests` scope to read is the bare minimum to run the bot in dry-run mode
- `pull_requests` scope to write to be able to update bot comment, assign user, apply label and request review
- `contents` scope to read to be able to check if the head branch is up to date with another one
- `commit_statuses` scope to write to be able to update pull request bot status check

#### Organization permissions

- `members` scope to read to be able to list the members of a team

#### Bot account role

For the bot to create a commit status on a repo - and only for this feature at the time of writing this - the GitHub account of the bot must either:

- have the `write` role on the repo
- have the `owner` role in the organization that owns the repo

## Usage

```bash
Expand Down

0 comments on commit 9156613

Please sign in to comment.