diff --git a/.github/workflows/slack-notify.yml b/.github/workflows/slack-notify.yml new file mode 100644 index 0000000..b771a26 --- /dev/null +++ b/.github/workflows/slack-notify.yml @@ -0,0 +1,24 @@ +name: Slack Notification of CI Status + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + slackNotification: + name: Slack CI status message + runs-on: ubuntu-latest + steps: + - name: Slack Notify on Failure + if: ${{ failure() }} + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + channel-id: 'C067F896WG5' + slack-message: "Github CI Result: ${{ job.status }}\nGithub PR/Commit URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file