Last active
July 19, 2020 12:29
-
-
Save Kazuki-tam/87058b50b356b667650f870aae6bcc63 to your computer and use it in GitHub Desktop.
slack-notify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Set COMMIT_MESSAGE | |
run: echo ::set-env name=COMMIT_MESSAGE::$(echo "${{ github.event.head_commit.message }}" | tr '\n' ' ') | |
- name: Slack Notification on SUCCESS | |
if: success() | |
uses: tokorom/action-slack-incoming-webhook@master | |
env: | |
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
text: Successfully automated deployment. | |
attachments: | | |
[ | |
{ | |
"color": "good", | |
"author_name": "${{ github.actor }}", | |
"author_icon": "${{ github.event.sender.avatar_url }}", | |
"fields": [ | |
{ | |
"title": "コミットメッセージ", | |
"value": "${{ env.COMMIT_MESSAGE }}" | |
}, | |
{ | |
"title": "GitHub Actions URL", | |
"value": "${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}" | |
}, | |
{ | |
"title": "差分表示 URL", | |
"value": "${{ github.event.compare }}" | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment