-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add condition checks to be able to check if pr author is member of an org in any way or not. #2469
Comments
It seems possible with: unless github.api.organization_member?('danger', github.pr_author)
message "@#{github.pr_author} is not a contributor yet, would you like to join the Danger org?"
end Note: the above would need to be converted to python. But it should be possible to do then with something like this: - organization-member=OrgName Which could then check if author of the pr is in |
IIUC what you want to know is if the author has write access to the repo? What's your use case? |
I want to have a rule check if they got write access to the repository so the rules can automatically add an label that controls merge so then when CI's pass it gets merged directly, while those that do not have write access would require someone with write access to review then approve and add the label themselves. |
Understaood. In practice, we do that already but we just follow your rule number 3 We use We could probably add a PR boolean attribute being |
Why not name it |
I'm afraid it's a bit too generic. Maybe https://docs.github.com/en/graphql/reference/enums#repositorypermission |
Ultimately might be even better to have |
I agree, author becoming it's own object would benefit here. |
Expected Behavior
I would like the following to be possible some point in the future for rule conditions to check the author of a pr if (assuming the repository is in an open source only org):
Actual Behavior
No such information is exposed that checks those 3 cases and if any true, returns true.
Steps to Reproduce the Problem
automerge
label.Workarounds
Currently the only workaround is to manually duplicate the rule x # of times and then hard code specific user names into the rule conditions for each person to check for. This is not robust as any members could be added / removed at any time breaking the intended rules and poses an issue. What is really wanted is for the bot to check without hard coding them in the rules to do the same thing with a much smaller and simpler config since people can join / leave at any moment in time.
Specifications
The text was updated successfully, but these errors were encountered: