Skip to content

Commit 64c4582

Browse files
committed
update documentation with multi-repo info
1 parent ab430e4 commit 64c4582

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Monorobot
22

3-
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.
3+
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.
44

55
## Setting Up
66

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

2727
### Documentation
2828

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

3131
* [Repository configuration](./documentation/config_docs.md)
3232
* [Secrets](./documentation/secret_docs.md)

documentation/secret_docs.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,39 @@ A secrets file stores sensitive information. Unlike the repository configuration
4646
| `slack_hooks` | list of channel names (`channel`) and their corresponding webhook endpoint (`url`) | No | - |
4747
| `gh_token` | specify to grant the bot access to private repositories; omit for public repositories | Yes | - |
4848
| `gh_hook_token` | specify to ensure the bot only receives GitHub notifications from pre-approved repositories | Yes | - |
49+
| `repositories` | an object mapping repository URLs to repository-specific GitHub secrets | Yes | - |
50+
| `allowed_repositories` | a whitelist of repository URLs to process payloads for | Yes | all incoming payloads are processed |
4951

5052
## `gh_token`
5153

5254
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.
5355

56+
*See `repositories` if you need to support multiple repositories that use different tokens.*
57+
5458
## `gh_hook_token`
5559

5660
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.
61+
62+
*See `repositories` if you need to support multiple repositories that use different tokens.*
63+
64+
## `repositories`
65+
66+
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.
67+
68+
Repository URLs should be fully qualified (include the protocol).
69+
70+
```json
71+
{
72+
"https://github.com/acme/runner" : {
73+
"gh_token": "XXX"
74+
},
75+
"https://git.acme.com/acme/coyote" : {
76+
"gh_token": "XXX",
77+
"gh_hook_token": "XXX"
78+
}
79+
}
80+
```
81+
82+
## `allowed_repositories`
83+
84+
Use this option to restrict incoming notifications from GitHub to approved repository URLs.

0 commit comments

Comments
 (0)