-
Notifications
You must be signed in to change notification settings - Fork 33
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
Use team keys for authors #88
Use team keys for authors #88
Conversation
4447ec0
to
76b9b0a
Compare
Use team keys for authors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising a PR! Looks good to me 👍 Clean code!
I'll update the dist and see if CI passes 🤞
I can't push commits to this branch, so I've made this PR #89 but it's still half-done. |
@necojackarc I pushed updates per PR comments. |
src/github.js
Outdated
return octokit.teams.listMembersInOrg({ | ||
org: context.repo.org, | ||
team_slug: team, | ||
})?.map((member) => member.login) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to check if it returns this in this format?
I haven't got around to but I wonder it may return a response in a data
property 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.github.com/en/rest/teams/members?apiVersion=2022-11-28#list-team-members
It does look like it returns an array. From the documentation the schema doesn't appear to be in a data
property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the document for the REST API wrapped in octokit
, so it doesn't tell us how octokit
returns its response. It may or may not have data
. octokit.repos.getContent
returns a response with a data
property, so I suspect octokit.teams.listMembersInOrg
may do the same thing, but I'm not sure yet. Need a way to play around with this API... or the official document (or reading the code...).
auto-request-review/src/github.js
Lines 45 to 50 in 4bb98f3
const { data: response_body } = await octokit.repos.getContent({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
path: config_path, | |
ref: context.ref, | |
}); |
Just bumping on this to see if I can help move it forward at all |
@hbrysiewicz Sorry for the late reply. I didn't manage to get around to GitHub until today. Your idea, design and implementation seem all good. I'm happy to help this PR get merged, but I can't push changes to your branch, so here's the first thing we have to do - could you run Once you push it, we can see if all the tests are running fine. |
6a253ba
to
25d2ece
Compare
Build has been pushed |
@necojackarc waiting for maintainer to approve the test run |
@hbrysiewicz Thanks. I need to find a way to let contributors run GitHub actions... |
@necojackarc Just pushed up the eslint fixes if you can run again. |
@hbrysiewicz Please could you back-merge the latest master to your branch so that you can run the CI workflows without approval? I believe this works by looking at the document (I've also added Node v18 to CI). #90 |
26373a3
to
bfcd8b9
Compare
@necojackarc All done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your contribution!
@necojackarc it looks like |
@hbrysiewicz Let me revert this first since this action is used in more than 400 repos, so I can't keep the latest version broken. Let's discuss it in the next PR you created. |
This reverts commit bf71b47.
It was not initially clear in README that
teams:{gh-team-name}
syntax was only used for reviewers. I tried using it for theper_author
keys and it (obviously) didn't work. So I wrote this in so that it would work. If the PR author is in theper_author
team:{gh-team-name}
collection, use the respective reviewer for assignment.For example, this configuration would assign reviewer
mario
when the PR author is in github teamkoopa-troop
.