Skip to content

Commit 0990960

Browse files
aladdin-afkdavid-allison
authored andcommitted
build(ci): Add 'Needs Review' label to opened PRs
Unless they are drafts This automates a task which maintainers could be pinged for Fixes 19958 Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
1 parent 7092a64 commit 0990960

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/label.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,21 @@ jobs:
206206
repo: context.repo.repo,
207207
labels: ['New contributor']
208208
})
209+
210+
# Add 'Needs Review' label to newly opened, non-draft PRs
211+
add_needs_review_label:
212+
if: github.event.action == 'opened' && !github.event.pull_request.draft
213+
permissions:
214+
contents: read
215+
pull-requests: write
216+
runs-on: ubuntu-latest
217+
steps:
218+
- uses: actions/github-script@v8
219+
with:
220+
script: |
221+
await github.rest.issues.addLabels({
222+
issue_number: context.issue.number,
223+
owner: context.repo.owner,
224+
repo: context.repo.repo,
225+
labels: ['Needs Review']
226+
})

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ If you feel your PR is no longer reviewable because it requires significant work
166166
#### Label guide
167167

168168
* **No label**
169-
* Please ping a maintainer to add a '**Needs Review**' label
169+
* PRs should not be unlabeled, please ping a maintainer if this occurs.
170170
* **[Needs Author Reply](https://github.com/ankidroid/Anki-Android/labels/Needs%20Author%20Reply)**
171171
* The PR will unlikely be looked at until requested changes are made.
172172
* **[Has Conflicts](https://github.com/ankidroid/Anki-Android/labels/Has%20Conflicts)**

0 commit comments

Comments
 (0)