|
| 1 | +## Notify about build failure |
| 2 | + |
| 3 | +Sends notifications about build failure to specified Slack channel and private Slack messages of failing commit author |
| 4 | + |
| 5 | +### Description |
| 6 | + |
| 7 | +Sends notification about build failure to specified Slack channel and direct Slack messages of failing commit author. In order to match GitHub name of commit authors and their Slack handles, the TopTeam API is used. |
| 8 | + |
| 9 | +### Inputs |
| 10 | + |
| 11 | +The list of arguments, that are used in GH Action: |
| 12 | + |
| 13 | +| name | type | required | default | description | |
| 14 | +| --------------------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | |
| 15 | +| `slack-bot-token` | string | ✅ | | Slack API token, needed for sending messages in Slack | |
| 16 | +| `top-team-api-key` | string | ✅ | | TopTeam API key, needed for fetching Company structure to match GitHub name of commit author to Slack handle | |
| 17 | +| `slack-channel-name` | string | ✅ | | Slack channel name (for example, `#-test-channel`) | |
| 18 | +| `github-commit-author-name` | string | ✅ | | GitHub name of commit author, needed for finding the Slack handle of commit author | |
| 19 | +| `github-action-run-url` | string | ✅ | | Failing GitHub Acton run URL (for example, `https://github.com/toptal/staff-portal/actions/runs/123`), needed for the notification message | |
| 20 | + |
| 21 | +### Outputs |
| 22 | + |
| 23 | +Not specified |
| 24 | + |
| 25 | +### ENV Variables |
| 26 | + |
| 27 | +Not specified |
| 28 | + |
| 29 | +### Usage |
| 30 | + |
| 31 | +GitHub Actions Notifications bot will send message to commit author and post a message in #-test-notifications-channel channel in Slack. The message will contain URL for the failing GitHub Action job run. |
| 32 | + |
| 33 | +```yaml |
| 34 | +jobs: |
| 35 | + notify-build-breaker: |
| 36 | + name: Notify about build failure |
| 37 | + steps: |
| 38 | + - uses: toptal/davinci-github-actions/notify-about-build-failure@master |
| 39 | + with: |
| 40 | + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} |
| 41 | + top-team-api-key: ${{ secrets.TOP_TEAM_API_KEY }} |
| 42 | + slack-channel-name: '#-test-notifications-channel' |
| 43 | + github-commit-author-name: ${{ github.event.pusher.name }} |
| 44 | + github-action-run-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 45 | +``` |
0 commit comments