Code Monkey home page Code Monkey logo

github-issues-notice's Introduction

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

github-issues-notice's People

Contributors

linyows avatar zaimy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

litencatt sujii

github-issues-notice's Issues

メッセージが表示されない

日本語で失礼します。ペパボのmewmoです。
社内で試験的に使ってみたところ、メッセージがうまく表示されない様子だったので報告します。

▼設定したスプレッドシートのキャプチャ
スクリーンショット 2021-12-01 18 14 31

▼実際にSlackで通知された状態のキャプチャ
スクリーンショット 2021-12-01 18 14 09

なにか設定方法など間違ってる点があったらすみません。ご指摘いただけますと幸いです。

Want to be notified of a closed pull request

Hi @linyows.
Thanks for the awesome OSS!
I always find it useful.

I want to be notified "if a specific label is given to a closed pull request".
I read the documentation and found the following description.

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

From reading the code, this seemed to be an Issue-only setting.

const state = task.labelProtection ? 'all' : 'open'
const issues = this.github.issues(repo, { labels, state })

In my opinion, it would be better to add a Closed condition to the following code.

const pulls = this.github.pullsWithoutDraftAndOnlySpecifiedLabels(
repo,
{ labels }
)


Is there some reason you are not getting Closed on pull requests?
If possible I will create a pull request.
It would be great if you could incorporate it.

Best Regards.

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.