Giter Club home page Giter Club logo

repo-notifier's Introduction

Repo-Notifier

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.

Features

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.

Supported Event Types

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

Supported Event Actions

Repo-Notifier currently supports the following event actions:

  • answered
  • assigned
  • closed
  • created
  • deleted
  • dismissed
  • edited
  • opened
  • reopened
  • review_requested
  • submitted

Custom Event Types

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.

Custom Event Actions

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.

Prerequisites

  1. 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 AppID and AppSecret for requesting the tenant_access_token to fetch Lark user information and send notifications.

  2. Configure bot permissions by referring to Request API Permissions, Batch Send Messages, and Batch Get User Information to set up corresponding permissions.

  3. Fetch Lark user information:

    1. Obtain the bot's tenant_access_token by referring to Obtain Tenant Access Token for Internal Applications.

    2. Obtain the department ID by referring to Search Departments.

    3. Obtain the list of users directly under a department by referring to Get Department Users.

    4. Save the user_id field from user information and map it to the githubId. Write it into the mapping.json file in the project root directory as follows:

      [
        {
          "githubId": "A_githubId",
          "larkId": "A_user_id"
        },
        {
          "githubId": "B_githubId",
          "larkId": "B_user_id"
        }
      ]
  4. After writing mapping.json, deploy the project and configure the bot's AppID and AppSecret in the environment variables:

    LARK_BOT_APP_ID=
    LARK_BOT_APP_SECRET=
  5. Fill in the webhook URL in GitHub. After deploying the project, get the project domain name. https://<your_domain>/api/handle-webhook is the webhook URL for the GitHub repository, which should be filled in the webhook configuration in the GitHub repository. configure-webhook

  6. After filling in the webhook in the GitHub repository, try performing some operations on the repository to see if notifications are received correctly.

repo-notifier's People

Contributors

viskeyy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.