Skip to content

Commit ababd1f

Browse files
committed
update documentation with multi-repo info
1 parent ff7bcaa commit ababd1f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ You can configure Monorobot to [unfurl GitHub links](https://api.slack.com/refer
5050

5151
### Documentation
5252

53-
The bot expects two configuration files to be present.
53+
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:
5454

5555
* [Repository configuration](./documentation/config_docs.md)
5656
* [Secrets](./documentation/secret_docs.md)

documentation/secret_docs.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ A secrets file stores sensitive information. Unlike the repository configuration
1717
|-|-|-|-|
1818
| `gh_token` | specify to grant the bot access to private repositories; omit for public repositories | Yes | - |
1919
| `gh_hook_token` | specify to ensure the bot only receives GitHub notifications from pre-approved repositories | Yes | - |
20+
| `repos` | an object mapping repository URLs to repository-specific GitHub secrets | Yes | - |
21+
| `allowed_repos` | a whitelist of repository URLs to process payloads for | Yes | all incoming payloads are processed |
2022
| `slack_access_token` | slack bot access token to enable message posting to the workspace | Yes | try to use webhooks defined in `slack_hooks` instead |
2123
| `slack_hooks` | list of channel names and their corresponding webhook endpoint | Yes | try to use token defined in `slack_access_token` instead |
2224
| `slack_signing_secret` | specify to verify incoming slack requests | Yes | - |
@@ -27,10 +29,36 @@ Note that either `slack_access_token` or `slack_hooks` must be defined.
2729

2830
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.
2931

32+
*See `repos` if you need to support multiple repositories that use different tokens.*
33+
3034
## `gh_hook_token`
3135

3236
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.
3337

38+
*See `repos` if you need to support multiple repositories that use different tokens.*
39+
40+
## `repos`
41+
42+
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.
43+
44+
Repository URLs should be fully qualified (include the protocol).
45+
46+
```json
47+
{
48+
"https://github.com/acme/runner" : {
49+
"gh_token": "XXX"
50+
},
51+
"https://git.acme.com/acme/coyote" : {
52+
"gh_token": "XXX",
53+
"gh_hook_token": "XXX"
54+
}
55+
}
56+
```
57+
58+
## `allowed_repos`
59+
60+
Use this option to restrict incoming notifications from GitHub to approved repository URLs.
61+
3462
## `slack_access_token`
3563

3664
Refer [here](https://api.slack.com/authentication/oauth-v2) for obtaining an access token via OAuth.

0 commit comments

Comments
 (0)