diff --git a/.github/actions/notify-slack.yml b/.github/actions/notify-slack.yml index 0210e173..a86edfbe 100644 --- a/.github/actions/notify-slack.yml +++ b/.github/actions/notify-slack.yml @@ -11,36 +11,40 @@ runs: using: "composite" steps: - - 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", - "value": "" - "short": true - }, - { - "title": "commit", - "value": "${{github.sha}}" - "short": true - }, - ] - } - ] - } + - name: testing + run: | + echo ${{inputs.alert_type}} + echo ${{inputs.heading_text}} + # - 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", + # "value": "" + # "short": true + # }, + # { + # "title": "commit", + # "value": "${{github.sha}}" + # "short": true + # }, + # ] + # } + # ] + # } diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7a3e3125..82a3ac5f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,12 +44,18 @@ jobs: if: success() steps: - name: Send slack notification on success - run: echo "Slack alert on success" + uses: ./xero-node/.github/actions/notify-slack + with: + heading_text: "Publish job has succeeded !" + alert_type: "good" notify-slack-on-failure: runs-on: ubuntu-latest needs: publish if: failure() steps: - - name: Send slack notification on failure - run: echo "Slack alert on failure" + - name: Send slack notification + uses: ./xero-node/.github/actions/notify-slack + with: + heading_text: "Publish job has failed, Please check the logs" + alert_type: "danger"