diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml new file mode 100644 index 0000000..c1b2ebb --- /dev/null +++ b/.github/workflows/notify_slack.yml @@ -0,0 +1,39 @@ +name: Slack Notifications + +on: + issues: + types: [opened, reopened, edited] + pull_request_target: + types: [opened, reopened, synchronize] + +permissions: {} + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send issue notification to Slack + if: github.event_name == 'issues' + uses: slackapi/slack-github-action@v2.1.1 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} + webhook-type: incoming-webhook + payload: | + { + "action": "${{ github.event.action }}", + "issue_url": "${{ github.event.issue.html_url }}", + "package_name": "${{ github.repository }}" + } + + - name: Send pull request notification to Slack + if: github.event_name == 'pull_request_target' + uses: slackapi/slack-github-action@v2.1.1 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }} + webhook-type: incoming-webhook + payload: | + { + "action": "${{ github.event.action }}", + "pr_url": "${{ github.event.pull_request.html_url }}", + "package_name": "${{ github.repository }}" + } \ No newline at end of file