GithubHelp home page GithubHelp logo

notify-old-issues's Introduction

This README was generated with ❤️ by readme-md-generator


Welcome to notify-old-issues

Version License: MIT

GitHub の古い issue を通知します。

Install

yarn install

Usage

# 最初にリポジトリをクローンしそのディレクトリに移動にする

# GitHub API のトークンを環境変数に設定する
$ export GITHUB_API_TOKEN=YOUR_GITHUB_API_TOKEN

# Chatwork API のトークンを環境変数に設定する
$ export CHATWORK_API_TOKEN=YOUR_CHATWORK_API_TOKEN

$ yarn build

# 実行例
$ node ./dist/index.js \
  # リポジトリのオーナー名
  --owner microsoft \
  # リポジトリ名
  --repository typescript \
  # issue の有効日数(これ以上経過したものを通知)
  --valid-days 7 \
  # 取得するイシューの状態(open, closed, all から選択)
  --issue-state open \
  # 通知先の Chatwork ルーム ID
  --chatwork-room-id: 999999999 \
  # 以下はGitHub Actionsで設定する場合不要
  # GitHub のユーザ名と通知先の Chatwotk メンションをマッピングする
  --chatwork-mapping '{ "sugu-sano": "[To: ] 佐野", "gonbe-nanashi": "[To: ] 名無しさん" }'

Sample GitHub Actions YAML

name: notify-old-issues
on:
  schedule:
    - cron: '0 13 * * 3'

jobs:
  notify:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - name: Checkout cli repository
        uses: actions/checkout@v2
        with:
          repository: sugu-sano/notify-old-issues
      - name: Restore cache
        uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
      - name: Insatll package
        run: yarn install
      - name: Build
        run: yarn build
      - name: Fetch expired issues and notify
        run: |
          node ./dist/index.js \
            --owner microsoft \
            --repository typescript \
            --valid-days 7 \
            --issue-state open \
            --chatwork-room-id 999999999 \
            --chatwork-mapping '{ "sugu-sano": "[To: ] 佐野", "gonbe-nanashi": "[To: ] 名無しさん" }'
    env:
      GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      CHATWORK_API_TOKEN: ${{ secrets.CHATWORK_API_TOKEN }}

TODO

  • HTTP リクエストを octokit/rest.js に変更する
  • テスト用の CI を組む

Author

👤 sugu-sano

notify-old-issues's People

Contributors

sugu-sano avatar sano-suguru avatar

Watchers

 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.