|
| 1 | +name: 'Discord Webhook' |
| 2 | +on: |
| 3 | + issues: |
| 4 | + types: [ opened ] |
| 5 | + pull_request_target: |
| 6 | + types: [ opened, reopened ] |
| 7 | + discussion: |
| 8 | + types: [ created ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + message: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: New Discussion |
| 15 | + |
| 16 | + if: ${{ (github.event_name == 'discussion') }} |
| 17 | + with: |
| 18 | + webhook-url: ${{ secrets.DISCORD_WEBHOOK_GITHUB }} |
| 19 | + avatar-url: https://avatars.githubusercontent.com/u/9919?s=200&v=4 |
| 20 | + embed-author-name: ${{ github.event.sender.login }} |
| 21 | + embed-author-url: ${{ github.event.sender.html_url }} |
| 22 | + embed-author-icon-url: ${{ github.event.sender.avatar_url }} |
| 23 | + embed-title: ${{ github.event.discussion.title }} |
| 24 | + embed-url: ${{ github.event.discussion.html_url }} |
| 25 | + embed-description: A **discussion** has been created in ${{ github.repository }}. |
| 26 | + |
| 27 | + - name: New Issue |
| 28 | + |
| 29 | + if: ${{ (github.event_name == 'issues') }} |
| 30 | + with: |
| 31 | + webhook-url: ${{ secrets.DISCORD_WEBHOOK_GITHUB }} |
| 32 | + avatar-url: https://avatars.githubusercontent.com/u/9919?s=200&v=4 |
| 33 | + embed-author-name: ${{ github.event.sender.login }} |
| 34 | + embed-author-url: ${{ github.event.sender.html_url }} |
| 35 | + embed-author-icon-url: ${{ github.event.sender.avatar_url }} |
| 36 | + embed-title: ${{ github.event.issue.title }} |
| 37 | + embed-url: ${{ github.event.issue.html_url }} |
| 38 | + embed-description: An **issue** has been opened in ${{ github.repository }}. |
| 39 | + |
| 40 | + - name: New Pull Request |
| 41 | + |
| 42 | + if: ${{ (github.event_name == 'pull_request_target') }} |
| 43 | + with: |
| 44 | + webhook-url: ${{ secrets.DISCORD_WEBHOOK_GITHUB }} |
| 45 | + avatar-url: https://avatars.githubusercontent.com/u/9919?s=200&v=4 |
| 46 | + embed-author-name: ${{ github.event.sender.login }} |
| 47 | + embed-author-url: ${{ github.event.sender.html_url }} |
| 48 | + embed-author-icon-url: ${{ github.event.sender.avatar_url }} |
| 49 | + embed-title: ${{ github.event.pull_request.title }} |
| 50 | + embed-url: ${{ github.event.pull_request.html_url }} |
| 51 | + embed-description: A **pull request** has been opened in ${{ github.repository }}. |
0 commit comments