|
1 | 1 | # job-notification
|
| 2 | + |
| 3 | +[](https://github.com/scribd/job-notification/actions/workflows/test.yml) |
| 4 | + |
| 5 | +A GitHub Action for sending job notifications |
| 6 | + |
| 7 | +## Table of contents |
| 8 | + |
| 9 | +- [Quick Start](#quick-start) |
| 10 | +- [Advanced usage](#advanced-usage) |
| 11 | + - [Customize message](#customize-message) |
| 12 | + - [Overwrite repository link](#overwrite-repository-link) |
| 13 | +- [Development](#development) |
| 14 | + - [Testing](#testing) |
| 15 | +- [Maintainers](#maintainers) |
| 16 | + |
| 17 | +## Quick Start |
| 18 | + |
| 19 | +```yaml |
| 20 | +steps: |
| 21 | + - name: Send notification |
| 22 | + if: always() # Always send notification regardless of the job status. |
| 23 | + uses: scribd/job-notification@main |
| 24 | + with: |
| 25 | + token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }} |
| 26 | + channel: test-release-notification |
| 27 | +``` |
| 28 | +
|
| 29 | +## Advanced usage |
| 30 | +
|
| 31 | +### Customize message |
| 32 | +
|
| 33 | +By default, the notification uses the latest commit message. You can overwrite that using the `message` field. |
| 34 | + |
| 35 | +To test the message formating, use the [Block Kit Builder](https://app.slack.com/block-kit-builder/). |
| 36 | + |
| 37 | +```yaml |
| 38 | +steps: |
| 39 | + - name: Send notification |
| 40 | + if: always() |
| 41 | + uses: scribd/job-notification@main |
| 42 | + with: |
| 43 | + token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }} |
| 44 | + channel: test-release-notification |
| 45 | + message: <https://github.com/${{ github.repository }}|Released update> |
| 46 | +``` |
| 47 | + |
| 48 | +### Overwrite repository link |
| 49 | + |
| 50 | +By default, the notification links to the repository that triggers the job. You can overwrite that using the `repository` field, which is useful for managing the release for multiple repositories in one place. See [scribd-api-proto](https://github.com/scribd/scribd-api-proto) for example. |
| 51 | + |
| 52 | +```yaml |
| 53 | +# Example: release.yml in scribd-api-proto |
| 54 | +steps: |
| 55 | + - name: Send notification |
| 56 | + if: always() |
| 57 | + uses: scribd/job-notification@main |
| 58 | + with: |
| 59 | + token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }} |
| 60 | + channel: test-release-notification |
| 61 | + repository: scribd/scribd-api-ruby |
| 62 | +``` |
| 63 | + |
| 64 | +## Development |
| 65 | + |
| 66 | +### Testing |
| 67 | + |
| 68 | +You can test your changes by pushing them to a branch, which will trigger the [test](.github/workflows/test.yml) workflow to send the notifications to the [test-release-notification](https://scribd.slack.com/archives/C04U68KR6CU) channel on Slack. |
| 69 | + |
| 70 | +## Maintainers |
| 71 | + |
| 72 | +Made with ❤️ by the Service Foundations teams. |
0 commit comments