|
| 1 | +name: Discord Webhook Notification |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + types: [opened, closed, reopened] |
| 9 | + pull_request_review: |
| 10 | + types: [submitted, edited, dismissed] |
| 11 | + issues: |
| 12 | + types: [opened, closed, reopened] |
| 13 | + release: |
| 14 | + types: [published, edited, released] |
| 15 | + check_run: |
| 16 | + types: [completed] |
| 17 | + check_suite: |
| 18 | + types: [completed] |
| 19 | + deployment: |
| 20 | + types: [created, completed] |
| 21 | + |
| 22 | +jobs: |
| 23 | + notify: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Send notification to Discord for Push |
| 27 | + if: github.event_name == 'push' |
| 28 | + run: | |
| 29 | + curl -H "Content-Type: application/json" \ |
| 30 | + -d "{\"content\": \"New push event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \ |
| 31 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 32 | +
|
| 33 | + - name: Send notification to Discord for Pull Request |
| 34 | + if: github.event_name == 'pull_request' |
| 35 | + run: | |
| 36 | + curl -H "Content-Type: application/json" \ |
| 37 | + -d "{\"content\": \"New pull request event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \ |
| 38 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 39 | +
|
| 40 | + - name: Send notification to Discord for Pull Request Review |
| 41 | + if: github.event_name == 'pull_request_review' |
| 42 | + run: | |
| 43 | + curl -H "Content-Type: application/json" \ |
| 44 | + -d "{\"content\": \"New pull request review event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \ |
| 45 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 46 | +
|
| 47 | + - name: Send notification to Discord for Issues |
| 48 | + if: github.event_name == 'issues' |
| 49 | + run: | |
| 50 | + curl -H "Content-Type: application/json" \ |
| 51 | + -d "{\"content\": \"New issue event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \ |
| 52 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 53 | +
|
| 54 | + - name: Send notification to Discord for Release |
| 55 | + if: github.event_name == 'release' |
| 56 | + run: | |
| 57 | + curl -H "Content-Type: application/json" \ |
| 58 | + -d "{\"content\": \"New release event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \ |
| 59 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 60 | +
|
| 61 | + - name: Send notification to Discord for Check Run |
| 62 | + if: github.event_name == 'check_run' |
| 63 | + run: | |
| 64 | + curl -H "Content-Type: application/json" \ |
| 65 | + -d "{\"content\": \"New check run completed in repository: ${{ github.repository }}.\"}" \ |
| 66 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 67 | +
|
| 68 | + - name: Send notification to Discord for Check Suite |
| 69 | + if: github.event_name == 'check_suite' |
| 70 | + run: | |
| 71 | + curl -H "Content-Type: application/json" \ |
| 72 | + -d "{\"content\": \"New check suite completed in repository: ${{ github.repository }}.\"}" \ |
| 73 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 74 | +
|
| 75 | + - name: Send notification to Discord for Deployment |
| 76 | + if: github.event_name == 'deployment' |
| 77 | + run: | |
| 78 | + curl -H "Content-Type: application/json" \ |
| 79 | + -d "{\"content\": \"New deployment event in repository: ${{ github.repository }}.\"}" \ |
| 80 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
0 commit comments