mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-21 21:33:25 +08:00
impr(PR labels): automatically label PRs "waiting for review/update" (@sanidhyas3s) (#5830)
!nuf
This commit is contained in:
parent
253efb7340
commit
1ba4be38d0
1 changed files with 58 additions and 0 deletions
58
.github/workflows/label-pr.yml
vendored
Normal file
58
.github/workflows/label-pr.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
name: Update PR labels
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [review_requested, review_request_removed]
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
update-pr-labels:
|
||||
name: Update PR Labels Based on Events
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Remove "waiting for update" label if comment is by PR author or a review is requested
|
||||
if: ${{ (github.event.issue.pull_request && github.event_name == 'issue_comment' && github.event.comment.user.login == github.event.issue.user.login) || (github.event.action == 'review_requested') }}
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
with:
|
||||
labels: waiting for update
|
||||
env:
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
|
||||
- name: Add "waiting for review" if a review is requested
|
||||
if: github.event.action == 'review_requested'
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
with:
|
||||
labels: waiting for review
|
||||
env:
|
||||
NUMBER: ${{ github.event.pull_request.number }}
|
||||
|
||||
- name: Remove "waiting for review" label if review request is removed
|
||||
if: github.event.action == 'review_request_removed'
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
with:
|
||||
labels: waiting for review
|
||||
env:
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
|
||||
- name: Add "waiting for update" if changes are requested
|
||||
if: ${{(github.event_name == 'pull_request_review' && github.event.review.state == 'changes_requested')}}
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
with:
|
||||
labels: waiting for update
|
||||
env:
|
||||
NUMBER: ${{ github.event.pull_request.number }}
|
||||
|
||||
- name: Remove "waiting for review" label after review
|
||||
if: ${{github.event_name == 'pull_request_review' }}
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
with:
|
||||
labels: waiting for review
|
||||
env:
|
||||
NUMBER: ${{ github.event.issue.number }}
|
Loading…
Reference in a new issue