先に方法
- name: Slack Notification when build failed if: failure() uses: rtCamp/action-slack-notify@master env: SLACK_CHANNEL: channel-name SLACK_COLOR: '#ff0000' SLACK_TITLE: ':fire::fire::fire: Build error! :fire::fire::fire:' SLACK_MESSAGE: "Build error! Please check github!" SLACK_USERNAME: GitHub Actions SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
実行結果
解説
if: failure()
で失敗した場合のみ起動するstepを設定できるrtCamp/action-slack-notify@master
は、slack通知のGitHub Action