Skip to content

Commit

Permalink
Used bot token instead of webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Oct 17, 2024
1 parent 1f8c0aa commit 403737d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/actions/notify-slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ inputs:
repository_name:
required: false
description: "repo name"
bot_token:
required: true
description: "slack app token"
channel_id:
required: true
description: "channel id"


runs:
Expand All @@ -39,8 +45,10 @@ runs:
id: slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}}
# SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}}
SLACK_BOT_TOKEN: ${{inputs.bot_token}}
with:
channel-id: ${{inputs.channel_id}}
payload: |
{
"text": "TESTING ---- ${{inputs.heading_text}}",
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
alert_type: "good"
job_status: ${{job.status}}
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
bot_token: ${{secrets.XERO_SLACK_BOT_TOKEN}}
channel_id: 'C07S29J583U'

notify-slack-on-failure:
runs-on: ubuntu-latest
Expand All @@ -77,3 +80,5 @@ jobs:
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
repository_name: ${{github.repository}}
bot_token: ${{secrets.XERO_SLACK_BOT_TOKEN}}
channel_id: 'C07S29J583U'

0 comments on commit 403737d

Please sign in to comment.