Skip to content

Commit

Permalink
Add reusable workflow for scheduled jobs to notify on slack.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim committed Jun 16, 2023
1 parent cf519bc commit 7585014
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/slack-notify.yaml
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

0 comments on commit 7585014

Please sign in to comment.