Skip to content

Commit

Permalink
Merge pull request #43 from playmoweb/add-webhook-url
Browse files Browse the repository at this point in the history
Add github workflows webhook slack
  • Loading branch information
Antonin-Deniau authored Oct 13, 2023
2 parents 5f7d8fa + ddfde63 commit 4ae5965
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4ae5965

Please sign in to comment.