Skip to content

Commit

Permalink
add slack webhook url
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Mar 15, 2024
1 parent 288635f commit 38c7bf4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/actions/slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ inputs:
channel:
description: "The channel to send the message to"
required: false
default: "slackapi/slack-github-action@v1"
default: "test-github-features"
webhook_url:
description: "The webhook url to use"
required: true
runs:
using: 'composite'
steps:
Expand All @@ -16,3 +19,5 @@ runs:
with:
channel-id: ${{ inputs.channel }}
slack-message: ${{ inputs.message }}
env:
SLACK_WEBHOOK_URL: ${{ inputs.webhook_url }}
2 changes: 2 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
uses: ./.github/actions/slack
with:
message: ":tada: Deployed to staging :white_check_mark: successfully!"
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Notify (failed deployment)
if: failure()
uses: ./.github/actions/slack
with:
message: ":fail: Failed to deploy to staging :red_flag: successfully!"
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
1 change: 1 addition & 0 deletions .github/workflows/ping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
- uses: ./.github/actions/slack
with:
message: 'Hello from GitHub Actions! :tada:'
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 2 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ jobs:
uses: ./.github/actions/slack
with:
message: ":tada: Deployed to production :white_check_mark: successfully!"
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Notify (failed deployment)
if: failure()
uses: ./.github/actions/slack
with:
message: ":fail: Failed to deploy to production :red_flag: successfully!"
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 38c7bf4

Please sign in to comment.