https://github.com/scribd/job-notification
A GitHub Action for sending job notifications
https://github.com/scribd/job-notification
github managed-by-terraform service-foundations
Last synced: 2 months ago
JSON representation
A GitHub Action for sending job notifications
- Host: GitHub
- URL: https://github.com/scribd/job-notification
- Owner: scribd
- License: mit
- Created: 2023-03-21T14:27:57.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T01:06:06.000Z (5 months ago)
- Last Synced: 2025-01-26T12:23:55.126Z (4 months ago)
- Topics: github, managed-by-terraform, service-foundations
- Homepage: https://github.com/scribd/job-notification
- Size: 36.1 KB
- Stars: 1
- Watchers: 10
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# job-notification
[](https://github.com/scribd/job-notification/actions/workflows/test.yml) [](https://github.com/semantic-release/semantic-release)
A GitHub Action for sending job notifications
## Table of contents
- [Quick Start](#quick-start)
- [Advanced usage](#advanced-usage)
- [Customize message](#customize-message)
- [Overwrite repository link](#overwrite-repository-link)
- [Development](#development)
- [Testing](#testing)
- [Commit messages](#commit-messages)
- [Maintainers](#maintainers)## Quick Start
```yaml
steps:
- name: Send notification
if: always() # Always send notification regardless of the job status.
uses: scribd/job-notification@main
with:
token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }}
channel: test-release-notification
```## Advanced usage
### Customize message
By default, the notification uses the latest commit message. You can overwrite that using the `message` field.
To test the message formating, use the [Block Kit Builder](https://app.slack.com/block-kit-builder/).
```yaml
steps:
- name: Send notification
if: always()
uses: scribd/job-notification@main
with:
token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }}
channel: test-release-notification
message:
```### Overwrite repository and status
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.
```yaml
# Example: release.yml in scribd-api-proto
steps:
- name: Send notification
if: always()
uses: scribd/job-notification@main
with:
token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }}
channel: test-release-notification
repository: scribd/scribd-api-ruby
```
Additionally, `status` can be set explicitly to `success`, `failure` or another custom value to override the default behavior of using status of the job calling this action.```yaml
steps:
- name: Send notification
uses: scribd/job-notification@main
with:
token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }}
channel: test-release-notification
status: warning
```## Development
### Testing
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.
### Commit messages
Please follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and [Angular commit message guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines) for writing commit messages.
## Maintainers
Made with ❤️ by the Service Foundations teams.