You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* yasu/support-multiple-repos:
cfg: make specifying repos mandatory
fmt
cfg: unify repos and allowed_repos into singlee field
add comments
state: add lock
docs: add info on multi-repo setup
test: recreate context per test case
cfg: add option to restrict handling of GH payloads to certain repo urls
cfg: allow repo-specific configuration of gh_token and gh_hook_token
github: move webhook signature checking logic out of parse_exn
ctx: allocate new hash table for every Context.make ()
state: store runtime repo state in a hash table indexed by repo url
cfg: make ctx store a hash tbl mapping urls to cfgs
add atd wrapper for hash tables
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Note: The `slack_access_token` must be configured in your secrets file for link
55
55
56
56
### Documentation
57
57
58
-
The bot expects two configuration files to be present.
58
+
Commit a configuration file to the root of each repository you want to support, and add a secrets file on the bot server itself. Read on for instructions to set up each file:
Copy file name to clipboardExpand all lines: documentation/secret_docs.md
+38-6Lines changed: 38 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,58 @@ A secrets file stores sensitive information. Unlike the repository configuration
8
8
9
9
```json
10
10
{
11
-
"gh_token": "",
12
-
"slack_access_token": ""
11
+
"repos": [
12
+
{
13
+
"url": "https://github.com/ahrefs/monorobot",
14
+
"gh_token": "XXX"
15
+
}
16
+
],
17
+
"slack_access_token": "XXX"
13
18
}
14
19
```
15
20
16
21
| value | description | optional | default |
17
22
|-|-|-|-|
18
-
|`gh_token`| specify to grant the bot access to private repositories; omit for public repositories | Yes | - |
19
-
|`gh_hook_token`| specify to ensure the bot only receives GitHub notifications from pre-approved repositories | Yes | - |
23
+
|`repos`| specify each target repository's url and its secrets | No | - |
20
24
|`slack_access_token`| slack bot access token to enable message posting to the workspace | Yes | try to use webhooks defined in `slack_hooks` instead |
21
25
|`slack_hooks`| list of channel names and their corresponding webhook endpoint | Yes | try to use token defined in `slack_access_token` instead |
Note that either `slack_access_token` or `slack_hooks` must be defined. If both are present, the bot will send notifications using webhooks.
25
29
26
-
## `gh_token`
30
+
## `repos`
31
+
32
+
Specifies which repositories to accept events from, along with any repository-specific overrides to secrets.
33
+
34
+
```json
35
+
[
36
+
{
37
+
"url": "https://github.com/ahrefs/runner",
38
+
"gh_token": "XXX"
39
+
},
40
+
{
41
+
"url": "https://git.ahrefs.com/ahrefs/coyote",
42
+
"gh_token": "XXX",
43
+
"gh_hook_token": "XXX"
44
+
}
45
+
]
46
+
```
47
+
48
+
| value | description | optional | default |
49
+
|-|-|-|-|
50
+
|`url`| the repository url. | No | - |
51
+
|`gh_token`| specify to grant the bot access to private repositories; omit for public repositories | Yes | - |
52
+
|`gh_hook_token`| specify to ensure the bot only receives GitHub notifications from pre-approved repositories | Yes | - |
53
+
54
+
### `repos`
55
+
56
+
Repository URLs should be fully qualified (include the protocol), with no trailing backslash.
57
+
58
+
### `gh_token`
27
59
28
60
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.
29
61
30
-
## `gh_hook_token`
62
+
###`gh_hook_token`
31
63
32
64
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.
0 commit comments