Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/process_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@

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",
Expand Down Expand Up @@ -69,7 +73,7 @@ def get_pr_merger_and_labels(pr_number: int) -> Tuple[str, Set[str]]:
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}")
2 changes: 1 addition & 1 deletion .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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