Skip to content

Commit

Permalink
Discussions の通知内容を修正 (#20)
Browse files Browse the repository at this point in the history
* Discussions の通知内容をちょい修正

* Update .github/workflows/discussions-notice.yml
  • Loading branch information
sawa-zen authored Jan 5, 2023
1 parent c0f1b1a commit a5b6bed
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/discussions-notice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,50 @@ jobs:
if: github.event.discussion && !github.event.comment
steps:
- run: |
curl -X POST -d '{ "text": "Created discussion: ${{ github.event.discussion.html_url }}" }' ${{ secrets.SLACK_WEBHOOK_URL }}
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 -d '{ "text": "Created discussion comment: ${{ github.event.comment.html_url }}" }' ${{ secrets.SLACK_WEBHOOK_URL }}
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

0 comments on commit a5b6bed

Please sign in to comment.