Repo-Notifier is a powerful web application designed to notify you whenever there is a new commit or other events in your repository. It currently supports notifications via Lark.
Repo-Notifier sends messages through a Lark bot to designated users when events such as push occur in a GitHub repository, preventing any miscommunication or overlooked important messages.
Repo-Notifier currently supports the following event types:
- discussion
- discussion_comment
- issue_comment
- issues
- pull_request
- pull_request_review
- pull_request_review_comment
- push
- star
Repo-Notifier currently supports the following event actions:
- answered
- assigned
- closed
- created
- deleted
- dismissed
- edited
- opened
- reopened
- review_requested
- submitted
In the project's root directory, the constant/constant.ts file lists the supported event types in ACCEPT_EVENT_TYPES. After adding new event types, corresponding event handling code must be written in the helper/handle_event.ts file and new event handling files added in the helper/send_message folder. Redeploy the project to activate the new event handling code.
In the project's root directory, the constant/constant.ts file lists the supported event actions in ACCEPT_EVENT_ACTIONS. To handle specific event actions, refer to the helper/send_message/issues.ts file for coding guidelines, and redeploy the project upon completion.
-
Create a Lark bot, as all notifications are sent through this bot. Create it on the Lark Open Platform. After creation, obtain the bot's
AppIDandAppSecretfor requesting thetenant_access_tokento fetch Lark user information and send notifications. -
Configure bot permissions by referring to Request API Permissions, Batch Send Messages, and Batch Get User Information to set up corresponding permissions.
-
Fetch Lark user information:
-
Obtain the bot's
tenant_access_tokenby referring to Obtain Tenant Access Token for Internal Applications. -
Obtain the department ID by referring to Search Departments.
-
Obtain the list of users directly under a department by referring to Get Department Users.
-
Save the
user_idfield from user information and map it to thegithubId. Write it into themapping.jsonfile in the project root directory as follows:[ { "githubId": "A_githubId", "larkId": "A_user_id" }, { "githubId": "B_githubId", "larkId": "B_user_id" } ]
-
-
After writing
mapping.json, deploy the project and configure the bot'sAppIDandAppSecretin the environment variables:LARK_BOT_APP_ID= LARK_BOT_APP_SECRET=
-
Fill in the webhook URL in GitHub. After deploying the project, get the project domain name.
https://<your_domain>/api/handle-webhookis the webhook URL for the GitHub repository, which should be filled in the webhook configuration in the GitHub repository. -
After filling in the webhook in the GitHub repository, try performing some operations on the repository to see if notifications are received correctly.
