masuidrive/slack-summarizer を家庭用Slackにインストールしてみたレポ
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
面白そうなので導入してみる
が、すでにインストール作業は終えてしまったので、記憶でレポを書く
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
作業は README.md の通りに行う
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
masuidrive/slack-summarizer
をフォークする
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
フォークしたリポジトリ (以後 単にリポジトリと書く) に Actions で使う Secrets を設定する
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
OpenAI の認証トークン
OpenAI の Web サイトにアクセスしてください
右上の"Sign In"ボタンをクリックし、アカウントにログインしてください
リンクされている OpenAPI の Web サイト
には Sign In は無かった
おそらく https://platform.openai.com/ ではないか?
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
Slack の API 認証トークン
Slack API の Web サイトにアクセスし、ログインしてください
"Create a new app"をクリックして、"From an app manifest"を選択し manifest に下記の内容をコピーします
(本題とは全然関係無いけど、Slackのアカウントがたくさんあってめんどう…)
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
画面左の"Install App"をクリックし、右に出る"Install App to Workspace"をクリックして、アプリをワークスペースにインストールします。インストールが完了すると、bot の OAuth アクセストークンが表示されます
このxoxb-で始まるトークンをコピーして Value に貼り付けます
トークンがどこにあるか迷った
インストール後に、左メニューの Install App
のページにあった
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
要約結果を投稿する Slack の channel_id
Slack で要約結果を投稿したいチャンネルを開きます
上部のチャンネル名をクリックし、出てきた Popup の最下部にある Channel ID を Value に貼り付けます
これは専用に新しくチャンネルを作った
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
Channel に bot をインストール
画面上部の検索窓から"Summarizer"を検索し、"Summarizer [APP]"をクリックします。
上の"Summarizer"をクリックし、"Add this app to a channel"をクリックして、要約結果を投稿したいチャンネルを指定します
ここが一番迷ったところ
Slackの検索窓に Summarizer
を入力しても App はでてこなかった
左メニューのAppで「アプリを追加する」で、Appの検索画面になるので、
そこで Summary
で検索、先ほどインストールしたAppが表示されるので追加する
その上で Summary
のメッセージを開き、アカウント名のリンクにホバーしてでてくるポップアップの
「チャンネルにこのアプリを連携する」をクリック
そして先ほど作ったチャンネルを選ぶ
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
GitHub のリポジトリで"Settings"タブを開き、左の"Actions"→"General"を開きます
"Actions permissions"の"Allow all actions and reusable workflows"を選択して保存してください
デフォルトで Allow all actions and reusable workflows
が選ばれていたが念のため Save した
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
手動実行してみる
リポジトリの Actions
を開き Summarizer
をひらく
ワークフローを有効にしてよいか聞かれる
(フォークしたリポジトリだから?メッセージ失念)
有効にすれば、手動実行 (Run workflow) ができる
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
(GitHub Actions で障害が発生していたけど、このセットアップ作業中に復旧した)
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
Actions の実行結果
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
すごい、要約されている
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
これにてインストール作業完了
![chatii](https://res.cloudinary.com/zenn/image/fetch/s--4cNbrcdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_70/https://storage.googleapis.com/zenn-user-upload/avatar/4d4aff57e1.jpeg)
雑感として
APIの発行などをよくやる人なら問題なく進められると思う