|
| 1 | +name: Rocket.Chat Pull Request push notifications |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ master, main ] |
| 6 | + types: [ labeled ] |
| 7 | + issues: |
| 8 | + types: [ labeled ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + rocketchat_pullrequest_notification: |
| 12 | + name: Someone labeled their Pull Request |
| 13 | + runs-on: ubuntu-latest |
| 14 | + if: ${{ github.event.pull_request && contains('comments welcome|help wanted|waiting for review', github.event.label.name) }} |
| 15 | + steps: |
| 16 | + - name: Push notification for a Pull Request labeled as "comments welcome" |
| 17 | + if: ${{ github.event.label.name == 'comments welcome' }} |
| 18 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} would like to get feedback on pull request ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
| 19 | + - name: Push notification for a Pull Request labeled as "help wanted" |
| 20 | + if: ${{ github.event.label.name == 'help wanted' }} |
| 21 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} needs help with pull request ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
| 22 | + - name: Push notification for a Pull Request labeled as "waiting for review" |
| 23 | + if: ${{ github.event.label.name == 'waiting for review' }} |
| 24 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} is waiting for a code review of pull request ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
| 25 | + rocketchat_issue_notification: |
| 26 | + name: Someone labeled their Issue |
| 27 | + runs-on: ubuntu-latest |
| 28 | + if: ${{ github.event.issue && contains('comments welcome|help wanted|waiting for review', github.event.label.name) }} |
| 29 | + steps: |
| 30 | + - name: Push notification for an Issue labeled as "comments welcome" |
| 31 | + if: ${{ github.event.label.name == 'comments welcome' }} |
| 32 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} would like to get feedback on issue ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
| 33 | + - name: Push notification for an Issue labeled as "help wanted" |
| 34 | + if: ${{ github.event.label.name == 'help wanted' }} |
| 35 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} needs help with issue ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
| 36 | + - name: Push notification for an Issue labeled as "waiting for review" |
| 37 | + if: ${{ github.event.label.name == 'waiting for review' }} |
| 38 | + run: curl "${{ secrets.ROCKETCHAT_SERVER }}/hooks/${{ secrets.ROCKETCHAT_HOOK_PR_NOTIFICATIONS }}" -d "text=${{ github.event.sender.login }} is waiting for a code review of issue ${{ github.event.pull_request.html_url }}" -d "username=${{ github.event.sender.login }}" -d "avatar=${{ github.event.sender.avatar_url }}" |
0 commit comments