|
| 1 | +name: "PR: Update Label on monday.com items based on PR Status" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request_review: |
| 5 | + types: [submitted, edited] |
| 6 | + |
| 7 | +jobs: |
| 8 | + set-status: |
| 9 | + name: "Update monday.com Labels to 'PR: Commented' / 'PR: Approved' / 'PR: Rejected'" |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + # If PR was 'COMMENTED' |
| 13 | + - name: "Update state of monday.com items to 'PR: Commented'" |
| 14 | + uses: polygon-software/action-monday-state@main |
| 15 | + if: ${{ github.event.review.state == 'commented' && github.base_ref != 'master' }} |
| 16 | + with: |
| 17 | + monday-token: ${{ secrets.MONDAY_TOKEN }} |
| 18 | + allow-no-item-id: true |
| 19 | + multiple: true |
| 20 | + text: ${{ github.event.pull_request.title }} |
| 21 | + prefix: '#' |
| 22 | + status-column-title: 'Item Status!' |
| 23 | + set-status: 'PR: Commented' |
| 24 | + |
| 25 | + # If PR was 'APPROVED' |
| 26 | + - name: "Update state of monday.com items to 'PR: Approved'" |
| 27 | + uses: polygon-software/action-monday-state@main |
| 28 | + if: ${{ github.event.review.state == 'approved' && github.base_ref != 'master' }} |
| 29 | + with: |
| 30 | + monday-token: ${{ secrets.MONDAY_TOKEN }} |
| 31 | + multiple: true |
| 32 | + allow-no-item-id: true |
| 33 | + text: ${{ github.event.pull_request.title }} |
| 34 | + prefix: '#' |
| 35 | + status-column-title: 'Item Status!' |
| 36 | + set-status: 'PR: Approved' |
| 37 | + |
| 38 | + # If PR was 'REJECTED' |
| 39 | + - name: "Update state of monday.com items to 'PR: Rejected'" |
| 40 | + uses: polygon-software/action-monday-state@main |
| 41 | + if: ${{ github.event.review.state == 'rejected' && github.base_ref != 'master' }} |
| 42 | + with: |
| 43 | + monday-token: ${{ secrets.MONDAY_TOKEN }} |
| 44 | + multiple: true |
| 45 | + allow-no-item-id: true |
| 46 | + text: ${{ github.event.pull_request.title }} |
| 47 | + prefix: '#' |
| 48 | + status-column-title: 'Item Status!' |
| 49 | + set-status: 'PR: Rejected' |
| 50 | + |
0 commit comments