Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] author-in-team isn't labeling when author is a member of the specified team #153

Closed
swrobel opened this issue Oct 4, 2024 · 3 comments · Fixed by #154
Closed

[Bug] author-in-team isn't labeling when author is a member of the specified team #153

swrobel opened this issue Oct 4, 2024 · 3 comments · Fixed by #154

Comments

@swrobel
Copy link
Contributor

swrobel commented Oct 4, 2024

I have tested this in our repo, and believe I have an explanation of why this isn't working:

The go github function that is called, GetOrgMembership, uses the "Get organization membership for a user" endpoint, which doesn't seem to contain any info about the teams within that org that the user is a member of. Also, we are passing a team string to the second argument, which expects an org string instead, leading to 404s always being returned in the logs from the action:

[Author is member of team] skip, GET https://api.github.com/orgs/{team}/memberships/{user}: 404 Not Found []

I think instead, you may need to use the GetTeamMembershipBySlug function, which requires:

  1. org identifier (perhaps this is already available somewhere for other API calls that are already being made by labeler? Otherwise, it will probably have to be added to config)
  2. team slug, as opposed to the team name (as currently documented), which can contain spaces
  3. user (we already have this)
@swrobel swrobel changed the title author-in-team isn't labeling when author is a member of the specified team [Bug] author-in-team isn't labeling when author is a member of the specified team Oct 4, 2024
@srvaroa
Copy link
Owner

srvaroa commented Oct 5, 2024

Many thanks for the report and triage. I will fix this in the next few days.

@srvaroa
Copy link
Owner

srvaroa commented Oct 9, 2024

I have just released this. The default action will now use the v.1.11.1 build which has this fix.

I don't have an actual org + teams to test this with, but do let me know if the behaviour works.

Thanks again for the diagnose.

@swrobel
Copy link
Contributor Author

swrobel commented Nov 25, 2024

Someone else opened an issue, but I added my findings here as this still isn't working for me (sorry, haven't had a chance to test until now) #160 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants