diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml index 0f91a4f6..0c482d03 100644 --- a/.github/actions/notify-slack/action.yml +++ b/.github/actions/notify-slack/action.yml @@ -11,6 +11,9 @@ inputs: job_status: required: true description: "status of the job" + XERO_SLACK_WEBHOOK_URL: + required: true + description: "webhook url for channel - public-sdk-events" runs: using: "composite" @@ -25,36 +28,36 @@ runs: echo ${{github.repository}} echo ${{github.sha}} - # - name: Send slack notification - # id: slack - # uses: slackapi/slack-github-action@v1.27.0 - # env: - # SLACK_WEBHOOK_URL: "" - # with: - # payload: | - # { - # "channel": "#public-sdk-events", - # "text": ${{inputs.heading_text}} - # "attachments": [ - # { - # "color": ${{inputs.alert_type}}, - # "fields": [ - # { - # "title": "Repository", - # "value": "${{github.repository}}" - # "short": true - # }, - # { - # "title": "Job Status", - # "value": "${{inputs.job_status}}" - # "short": true - # }, - # { - # "title": "commit", - # "value": "${{github.sha}}" - # "short": true - # }, - # ] - # } - # ] - # } + - name: Send slack notification + id: slack + uses: slackapi/slack-github-action@v1.27.0 + env: + SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}} + with: + payload: | + { + "channel": "#public-sdk-events", + "text": ${{inputs.heading_text}} + "attachments": [ + { + "color": ${{inputs.alert_type}}, + "fields": [ + { + "title": "Repository", + "value": "${{github.repository}}" + "short": true + }, + { + "title": "Job Status", + "value": "${{inputs.job_status}}" + "short": true + }, + { + "title": "commit", + "value": "${{github.sha}}" + "short": true + }, + ] + } + ] + } diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c413b976..3728917b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,6 +55,7 @@ jobs: heading_text: "Publish job has succeeded !" alert_type: "good" job_status: ${{job.status}} + XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}} notify-slack-on-failure: runs-on: ubuntu-latest @@ -73,3 +74,4 @@ jobs: heading_text: "Publish job has failed. Check the details here: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" alert_type: "danger" job_status: ${{job.status}} + XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}