Skip to content

Instantly share code, notes, and snippets.

@Kazuki-tam
Last active July 19, 2020 12:29
Show Gist options
  • Save Kazuki-tam/87058b50b356b667650f870aae6bcc63 to your computer and use it in GitHub Desktop.
Save Kazuki-tam/87058b50b356b667650f870aae6bcc63 to your computer and use it in GitHub Desktop.
slack-notify
- 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