Skip to content

auto-add 'Needs Review' label to non-draft PRs( #19958)#19961

Closed
gurnoorpannu wants to merge 1 commit intoankidroid:mainfrom
gurnoorpannu:ci/add-needs-review-label
Closed

auto-add 'Needs Review' label to non-draft PRs( #19958)#19961
gurnoorpannu wants to merge 1 commit intoankidroid:mainfrom
gurnoorpannu:ci/add-needs-review-label

Conversation

@gurnoorpannu
Copy link
Contributor

Purpose / Description

Automatically adds the "Needs Review" label to newly opened pull requests that are not drafts.
This streamlines the PR review process by ensuring all non-draft PRs are immediately flagged for review, reducing manual labeling overhead for maintainers.

Fixes

Fixes #19958

Approach

Added a new job add_needs_review_label to the .github/workflows/label.yml workflow that:

  1. Triggers when a pull request is opened (github.event.action == 'opened')
  2. Checks that the PR is not a draft (github.event.pull_request.draft == false)
  3. Automatically applies the Needs Review label using the GitHub REST API
    The implementation follows the existing pattern used in the add_new_contributor_label job and uses the same trusted actions/github-script@v8 action already present in the workflow.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration (SDK version(s), emulator or physical, etc)

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

Checklist

Please, go through these checks before submitting the PR.

  • [Y ] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [ Y] You have commented your code, particularly in hard-to-understand areas
  • [ Y] You have performed a self-review of your own code
  • [ NA] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [ NA] UI Changes: You have tested your change using the Google Accessibility Scanner

Maintainers:

  • Add the Licenses Adds a resource under an open source license See wiki: Licences label
  • Update the licenses wiki when merging
    --->

- Add new job 'add_needs_review_label' to label.yml workflow
- Automatically applies 'Needs Review' label when PR is opened
- Only applies to non-draft pull requests
- Fixes ankidroid#19958
@sanjaysargam
Copy link
Member

@aladdin-afk Already made PR.
from next time, before working on issue kindly check whether anyone already assigned to the issue? or anyone already made a PR?
If no one assigned, ask to assign the issue and then you can start working

@criticalAY
Copy link
Contributor

Duplicate PR, please see the original issue and if anyone is working on it or there is an active open PR then don't open duplicates, closing it in ref. of

@criticalAY criticalAY closed this Dec 29, 2025
@gurnoorpannu
Copy link
Contributor Author

oh mybad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Add 'Needs Review' label to opened PRs

3 participants