Skip to content

Commit

Permalink
update documentation with multi-repo info
Browse files Browse the repository at this point in the history
  • Loading branch information
yasunariw committed Dec 25, 2020
1 parent ab430e4 commit 64c4582
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Monorobot

A Slackbot for GitHub monorepos. Configure how repo notifications should be routed to specified Slack channels based on file prefixes, issue/PR labels, and CI build statuses.
A Slackbot for GitHub monorepos. Configure how repo notifications should be routed to specified Slack channels based on file prefixes, issue/PR labels, and CI build statuses. Supports custom notification behavior for multiple repositories.

## Setting Up

Expand All @@ -26,7 +26,7 @@ Run the `_build/default/src/notabot.exe` binary. The following commands are supp

### Documentation

The bot expects two configuration files to be present.
Add a configuration file to each repository you want to support, and a secrets file on the bot server itself. Read on for instructions to set up each file:

* [Repository configuration](./documentation/config_docs.md)
* [Secrets](./documentation/secret_docs.md)
Expand Down
28 changes: 28 additions & 0 deletions documentation/secret_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,39 @@ A secrets file stores sensitive information. Unlike the repository configuration
| `slack_hooks` | list of channel names (`channel`) and their corresponding webhook endpoint (`url`) | No | - |
| `gh_token` | specify to grant the bot access to private repositories; omit for public repositories | Yes | - |
| `gh_hook_token` | specify to ensure the bot only receives GitHub notifications from pre-approved repositories | Yes | - |
| `repositories` | an object mapping repository URLs to repository-specific GitHub secrets | Yes | - |
| `allowed_repositories` | a whitelist of repository URLs to process payloads for | Yes | all incoming payloads are processed |

## `gh_token`

Some operations, such as fetching a config file from a private repository, or the commit corresponding to a commit comment event, require a personal access token. Refer [here](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) for detailed instructions on token generation.

*See `repositories` if you need to support multiple repositories that use different tokens.*

## `gh_hook_token`

Refer [here](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/securing-your-webhooks) for more information on securing webhooks with a token.

*See `repositories` if you need to support multiple repositories that use different tokens.*

## `repositories`

If you're using Monorobot for multiple repositories that need different secrets (e.g., one on github.com and another on GitHub Enterprise), you can provide them as an object. Secrets defined here will take precedence over those defined at the top level of the secrets file.

Repository URLs should be fully qualified (include the protocol).

```json
{
"https://github.com/acme/runner" : {
"gh_token": "XXX"
},
"https://git.acme.com/acme/coyote" : {
"gh_token": "XXX",
"gh_hook_token": "XXX"
}
}
```

## `allowed_repositories`

Use this option to restrict incoming notifications from GitHub to approved repository URLs.

0 comments on commit 64c4582

Please sign in to comment.