Add github workflows webhook slack #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |