Skip to content

Commit

Permalink
pr_labeler: exempt bots from porting_guide check
Browse files Browse the repository at this point in the history
For example, patchback is not a release manager, but we still want it to
backport Porting Guide PRs.
  • Loading branch information
gotmax23 committed Oct 18, 2023
1 parent dddfd7e commit 746662c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hacking/pr_labeler/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,21 @@ def no_body_nag(ctx: IssueOrPrCtx) -> None:

def warn_porting_guide_change(ctx: PRLabelerCtx) -> None:
"""
Complain if a user outside of the Release Management WG changes porting_guide
Complain if a non-bot user outside of the Release Management WG changes
porting_guide
"""
user = ctx.pr.user.login
if user.endswith("[bot]"):
return

# If the API token does not have permisisons to view teams in the ansible
# org, fall back to an empty list.
members = []
try:
members = get_team_members(ctx, "release-management-wg")
except github.UnknownObjectException:
log(ctx, "Failed to get members of @ansible/release-management-wg")
if ctx.pr.user.login in members:
if user in members:
return

matches: list[str] = []
Expand Down

0 comments on commit 746662c

Please sign in to comment.