Skip to content

scribd/job-notification

Repository files navigation

job-notification

CI semantic-release: angular

A GitHub Action for sending job notifications

Table of contents

Quick Start

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.

steps:
  - name: Send notification 
    if: always()
    uses: scribd/job-notification@main
    with:
      token: ${{ secrets.SCRIBD_SLACK_GENERIC_TOKEN }}
      channel: test-release-notification
      message: <https://github.com/${{ github.repository }}|Released update>

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 for example.

# 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.

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 workflow to send the notifications to the test-release-notification channel on Slack.

Commit messages

Please follow Conventional Commits and Angular commit message guidelines for writing commit messages.

Maintainers

Made with ❤️ by the Service Foundations teams.