-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (26 loc) · 1.21 KB
/
notify-slack-chat-write.yml
File metadata and controls
30 lines (26 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# このワークフローでは、GitHub Discussionsに新しいトピックが作成されたときに
# Slackの指定したチャネルにその情報を通知します。通知には以下の情報が含まれます:
# - 新しいディスカッションのタイトル
# - 投稿者のユーザー名
# - ディスカッションのURL
#
# Slackへの通知の方法についての詳細は、以下のリンクにあります:
# https://github.com/marketplace/actions/slack-send#technique-2-slack-app
# Slackに通知を送信するためのGitHub Actionsワークフロー
name: Notify Slack using chat:write Scope
# GitHub Discussionsの新規作成イベントをトリガーに設定
on:
discussion:
types: [created]
jobs:
notify-slack:
runs-on: ubuntu-latest
steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: "New discussion posted: ${{ github.event.discussion.title }} by ${{ github.event.discussion.user.login }}. Check it out here: ${{ github.event.discussion.html_url }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}