From feabfb631bdcdf08541f005a2edb871e196193eb Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 31 Jul 2023 01:49:03 +0000 Subject: [PATCH] labeler: retrieve author_association from event data The Github Actions API token apparently doesn't have sufficient ACLs to retrieve this from the API. Fixes: https://github.com/ansible/ansible-documentation/issues/204 --- hacking/pr_labeler/label.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hacking/pr_labeler/label.py b/hacking/pr_labeler/label.py index 8356717b0b3..9c7d708c51a 100644 --- a/hacking/pr_labeler/label.py +++ b/hacking/pr_labeler/label.py @@ -160,8 +160,11 @@ def new_contributor_welcome(ctx: IssueOrPrCtx) -> None: # This contributor has already been welcomed! if "new_contributor" in ctx.previously_labeled: return - log(ctx, "author_association is", ctx.member.raw_data["author_association"]) - if ctx.member.raw_data["author_association"] not in { + author_association = ctx.event_member.get( + "author_association", ctx.member.raw_data["author_association"] + ) + log(ctx, "author_association is", author_association) + if author_association not in { "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", }: