Unverified Commit 6d459c7b authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Update PR labeling requirements (#4618)

parent 8fe72d13
......@@ -12,15 +12,19 @@ from typing import Any, Optional, Set, Tuple
import requests
# If the PR has any of these labels, we accept it as properly labeled.
REQUIRED_LABELS = {
# For a PR to be properly labeled it should have one primary label and one secondary label
PRIMARY_LABELS = {
"new feature",
"bug",
"code quality",
"enhancement",
"bc-breaking",
"dependency issue",
"deprecation",
"other",
}
SECONDARY_LABELS = {
"dependency issue",
"module: c++ frontend",
"module: ci",
"module: datasets",
......@@ -69,7 +73,7 @@ if __name__ == "__main__":
sys.exit(0)
merger, labels = get_pr_merger_and_labels(pr_number)
is_properly_labeled = bool(REQUIRED_LABELS.intersection(labels))
is_properly_labeled = bool(PRIMARY_LABELS.intersection(labels) and SECONDARY_LABELS.intersection(labels))
if not is_properly_labeled:
print(f"@{merger}")
......@@ -32,4 +32,4 @@ jobs:
message: |
Hey ${{ steps.commit.outputs.merger }}!
You merged this PR, but no labels were added.
You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment