Skip to content

Commit

Permalink
labeler: retrieve author_association from event data
Browse files Browse the repository at this point in the history
The Github Actions API token apparently doesn't have sufficient ACLs to
retrieve this from the API.

Fixes: #204
  • Loading branch information
gotmax23 committed Jul 31, 2023
1 parent 1f1252d commit feabfb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hacking/pr_labeler/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}:
Expand Down

0 comments on commit feabfb6

Please sign in to comment.