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
Automatic check will be triggered based on the cron expression. In the example, `0 */5 * * * *` means "at every 5th minute". cron documentation: <https://docs.rs/cron/latest/cron>.
@@ -44,6 +45,7 @@ My instance: <https://github.com/linyinfeng/dotfiles/blob/main/nixos/profiles/se
44
45
services.commit-notifier = {
45
46
enable = true;
46
47
cron = "0 */5 * * * *";
48
+
adminChatId = "{YOUR_ADMIN_CHAT_ID}";
47
49
tokenFiles = {
48
50
telegramBot = /path/to/telegram/bot/token;
49
51
github = /path/to/github/token;
@@ -71,7 +73,7 @@ The telegram bot has only one command `/notifier`. But this command provides a f
71
73
72
74
## Allow List
73
75
74
-
Since the bot can clone any git repository into its working directory, only manually allowed users/groups can access the bot.
76
+
Currently the bot use `GITHUB_TOKEN` to check status for issues/pull requests, so only manually allowed users/groups can access the bot.
75
77
76
78
The bot in a new chat returns this kind of error:
77
79
@@ -92,15 +94,77 @@ Currently, the bot does not have an admin interface in telegram. So adding chats
92
94
* For direct chat:
93
95
94
96
```console
95
-
$ cd {WORKING_DIR}
96
-
$ mkdir 888888888 # chat id
97
+
$ mkdir -p {WORKING_DIR}/chats/888888888 # chat id
97
98
```
98
99
99
100
* For group chat
100
101
101
102
```console
102
-
$ cd {WORKING_DIR}
103
-
$ mkdir _1008888888888 # chat id (replace "-" with "_")
103
+
$ mkdir -p {WORKING_DIR}/chats/_1008888888888 # chat id (replace "-" with "_")
104
104
```
105
105
106
106
**Make sure the new directory is writable by `commit-notifier`.** All data (repositories, settings, check results) related to the chat will be saved in the directory.
107
+
108
+
## Migration Guide
109
+
110
+
### From `0.1.x` to `0.2.0`
111
+
112
+
There are several differences between `0.1.x` and `0.2.x`.
113
+
114
+
* In `0.1.x`, chats data are saved at `{WORKING_DIR}`; in `0.2.x`, chats data are saved in `{WORKING_DIR}/chats`.
115
+
* In `0.1.x`, repositories and their settings are managed by every chat; in `0.2.x`, repositories and their settings are saved in `{WORKING_DIR}/repositories`, and can only managed by the admin chat. Also, in `0.2.x`, repositories are shared between all chats.
116
+
* In `0.1.x`, caches are built in a per-commit manner; in `0.2.x`, caches are built in a per-branch manner, including every branch matches `--branch-regex`.
117
+
118
+
#### How to migrate
119
+
120
+
1. Backup old `{WORKING_DIR}` to `{BACKUP_DIR}`.
121
+
2. Start the bot.
122
+
3. Check old configurations in `{BACKUP_DIR}`, find all repositories.
123
+
4. In admin chat, manually run `/notifier repo-add ...` for each repositories.
124
+
5. Properly configure each repositories.
125
+
126
+
* Use `/notifier repo-edit ...` to set branch regex. Use `/notifier condition-add ...` to set conditions.
127
+
128
+
* Or just edit `repositories/{REPO_NAME}/settings.json` manually.
129
+
130
+
<details>
131
+
<summary>An example configuration for nixpkgs</summary>
0 commit comments