/github-issues-notice

:octocat: Notify labeled issues to Slack

Primary LanguageTypeScriptMIT LicenseMIT

GitHub Issues Notice

Notify slack the title of the specified repository and label issues on GAS.

Slack notification example is:

example

Usage

  1. Deploy this

    $ npm i
    $ npx clasp login
    $ npx clasp create 'GitHub Issues Notice' --rootDir ./src
    $ npx clasp push
  2. Create google spreadsheet. For example:

    Enabled Channel Time Mention Repository Label/Threshold/Message Stats Idle Period Add Relations Only P/R Label Protection Show Organization No Holiday
    [x] general 09
    13
    17
    @dev foo/bar
    foo/baz
    WIP/5/There are a lot of things in progress. [x] 60 [x] [ ] [ ] [x] [ ]
    [x] dev 13
    1750
    @sre foo/abc needs-review/3/@techlead Please need review.
    WIP/5/Yo.
    [x] 45 [ ] [x] [ ] [ ] [x]
    [ ] ... ... ... ... ... [ ] [ ] [ ] [x] [ ] [ ]
    • Sheet name is config
    • Config start 2nd row, 1st row is subject
  3. Set script properties as ENV(File > Project properties > Script properties)

    • SLACK_ACCESS_TOKEN
    • GITHUB_ACCESS_TOKEN
    • SHEET_ID
    • GITHUB_API_ENDPOINT(optional)
  4. Add project trigger(Edit > Current project's triggers > Add trigger)

    • Choose which function to run: notify
    • Which run at deployment: head
    • Select event source: Time-driven
    • Select type of time based trigger: Minute timer
    • Select hour interval: Every minute

Stats

Stats reports issues total count, pull-requests total count and reactive percent. Reactive percent derives from proactive labeled issues and other issues count. If no proactive labels, no reports. By attaching proactive label to issues, it will be visible whether the work of the team is healthy.

Idle Period

If there is a number of days in the Idle period, it will be automatically closed if there are no issues or pulls that have not been updated over that number of days. If you do not want to use this function, please set it to blank or 0.

Add Relations

Add relationship to notifications to Slack. Specifically, include assignees and reviewers. If you use this option, you should set code review assignments on Github.

Only P/R

The target of monitoring is only pull requests other than draft.

Label Protection

Closed Issue is also monitored for Issue label. This will notify you of any issues that have been accidentally closed.

Show Organization

Add organization name to the display If you want to notify multiple organizations.

No Holiday

This notification usually does not notify you on holidays. Use this option to run it regardless of holidays.

Contribution

  1. Fork (https://github.com/linyows/github-issues-notice/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the npm ci command and confirm that it passes
  6. Create a new Pull Request

Author

linyows