From ddfde6375e329bcfff5314ce8e7fe756c65e120d Mon Sep 17 00:00:00 2001 From: Antonin Deniau Date: Fri, 13 Oct 2023 09:51:28 +0000 Subject: [PATCH] Add github workflows webhook slack --- .github/workflows/notify.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 0000000..b3b05d1 --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,39 @@ +name: Notify +on: + pull_request: + types: [opened] + issues: + types: [opened] + pull_request_comment: + +jobs: + integration_test_incoming_webhook: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: npm ci && npm run build + - run: echo "${{ github.event_name }}" + - name: Notify slack on pull request + if: ${{ github.event_name == 'pull_request' }} + id: slackIncoming + uses: ./ + payload: "{\"text\":\"New pull request on repository ${{ github.repository }}: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}\"}" + env: + SLACK_WEBHOOK_URL: ${{ vars.SLACK_INCOMING_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Notify slack on issue + if: ${{ github.event_name == 'issues' }} + id: slackIncoming + uses: ./ + payload: "{\"text\":\"New issue on repository ${{ github.repository }}: ${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.number }}\"}" + env: + SLACK_WEBHOOK_URL: ${{ vars.SLACK_INCOMING_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Notify slack on pull request comment + if: ${{ github.event_name == 'pull_request_comment' }} + id: slackIncoming + uses: ./ + payload: "{\"text\":\"New comment on repository ${{ github.repository }}: ${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.number }}\"}" + env: + SLACK_WEBHOOK_URL: ${{ vars.SLACK_INCOMING_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK