LoginSignup
0
0

More than 5 years have passed since last update.

Danger JS の Typetalk 通知プラグインを作った話

Posted at

概要

Danger JS の Typetalk 通知プラグイン danger-plugin-typetalk を作ったので紹介する記事です。

前提知識

Typetalk って何?という方は こちら

Danger JS とは?

Danger runs during your CI process, and gives teams the chance to automate common code review chores.

プルリクのコードレビューでよくある指摘 (console.log 残ってるよ!とか)を自動チェックするためのツールです。 dangerfile.js というチェック内容を定義したファイルを作成して使用します。今回は Typetalk へ通知を送るためのプラグインを作ったので基本的な使い方をご紹介します。

手順

1) Typetalk のボットを作成します。

Screen Shot 2019-02-03 at 22.56.20.png

メッセージ投稿が必要なので、 topic.post にチェックをつけます。

2) サンプル用のリポジトリをダウンロードします。

$ git clone git@github.com:is2ei/danger-plugin-typetalk-test.git
$ cd danger-plugin-typetalk-test

3) パッケージをインストールします。

$ npm install

4) ボットのトークンと、ボットを作成したトピックの ID を環境変数に設定します。

$ export TYPETALK_TOPIC_ID=xxxxx # トピックの ID を入力してください。
$ export TYPETALK_TOKEN=xxxxxxxxx # ボットのトークンを入力してください。

5) Danger JS を実行します。

$ npm run danger-local

6) Typetalk にメッセージが投稿されます。

Screen Shot 2019-02-03 at 23.02.55.png

手順は以上となります。いかがだったでしょうか。フィードバック歓迎です :pray:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0