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

Open
swrobel opened this issue Oct 4, 2024 · 1 comment

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.

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

No branches or pull requests

2 participants