Skip to content

.github/workflows/discussions-notice.yml #77

.github/workflows/discussions-notice.yml

.github/workflows/discussions-notice.yml #77

on:
discussion:
types: [created]
discussion_comment:
types: [created]
jobs:
discussion_created:
runs-on: ubuntu-latest
if: github.event.discussion && !github.event.comment
steps:
- run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} \
-H 'Content-Type: application/json' \
-d @- << EOF
{
"text": "*<${{ github.event.discussion.user.html_url }}|${{ github.event.discussion.user.login }}>* が Discussions を作成しました",
"attachments": [
{
"color": "#CCCCCC",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ github.event.discussion.html_url }}|${{ github.event.discussion.title }}>*\n${{ github.event.discussion.body }}",
}
}
]
}
]
}
EOF
discussion_commented:
runs-on: ubuntu-latest
if: github.event.discussion && github.event.comment
steps:
- run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK_URL }} \
-H 'Content-Type: application/json' \
-d @- << EOF
{
"text": "*<${{ github.event.comment.user.html_url }}|${{ github.event.comment.user.login }}>* が Discussions にコメントしました",
"attachments": [
{
"color": "#CCCCCC",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ github.event.comment.html_url }}|${{ github.event.discussion.title }}>*\n${{ github.event.comment.body }}",
}
}
]
}
]
}
EOF