Auto-label PR if above threshold for positive reactions (#13605)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
a1e72d3ffd
commit
0b0bc56675
1 changed files with 5 additions and 0 deletions
5
.github/workflows/merge-main-into-prs.yml
vendored
5
.github/workflows/merge-main-into-prs.yml
vendored
|
|
@ -47,6 +47,11 @@ jobs:
|
||||||
|
|
||||||
for pr in repo.get_pulls(state='open', sort='created'):
|
for pr in repo.get_pulls(state='open', sort='created'):
|
||||||
try:
|
try:
|
||||||
|
# Label PRs as popular for positive reactions
|
||||||
|
reactions = pr.as_issue().get_reactions()
|
||||||
|
if sum([(1 if r.content not in {"-1", "confused"} else 0) for r in reactions]) > 5:
|
||||||
|
pr.set_labels(*("popular",) + tuple(l.name for l in pr.get_labels()))
|
||||||
|
|
||||||
# Get full names for repositories and branches
|
# Get full names for repositories and branches
|
||||||
base_repo_name = repo.full_name
|
base_repo_name = repo.full_name
|
||||||
head_repo_name = pr.head.repo.full_name
|
head_repo_name = pr.head.repo.full_name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue