OSS-Docs-Tools / code-owner-self-merge

A GitHub Action for letting CODEOWNERS merge PRs via green PR reviews
MIT License
53 stars 16 forks source link

Action doesn't work for organization teams #13

Open erickzhao opened 4 years ago

erickzhao commented 4 years ago

Hey there, this is a super useful plugin! However, it doesn't seem to work with the @org/team-name syntax as specified in the CODEOWNERS spec.

It seems like the codeowners npm package only returns the raw team name rather than its members, so a member of the team saying LGTM unfortunately does nothing here (example).

I'm not sure how feasible this is, but there is a List Team Members API in octokit that exists.

orta commented 4 years ago

Yeah - given that any username with a slash must be a team member, I think it's totally reasonable to add code which uses the API to determine if they have the right to merge 👍🏻

You're welcome to give it a shot

orta commented 4 years ago

Looking at your example, the bot couldn't ping the team either - so maybe there's a general constraint on how that works too