-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reusable workflow for scheduled jobs to notify on slack.
- Loading branch information
1 parent
cf519bc
commit 7585014
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This re-usable workflow file will trigger a Slack notification on the channel configure via the Webhook URL. | ||
# It currently comments a number of fields, but you can add or remove them as you see fit. | ||
# | ||
# To configure a Slack Webhook URL, follow the instructions here: https://api.slack.com/messaging/webhooks | ||
on: | ||
workflow_call: | ||
inputs: | ||
notify-slack: # The name of the input you defined in the workflow file that will trigger this workflow. | ||
required: true | ||
type: boolean | ||
default: true | ||
|
||
jobs: | ||
slack-notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
if: inputs.notify-slack |