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

Feature: Add support for Repo/Org Push rulesets #3274

Closed
srgustafson8 opened this issue Sep 20, 2024 · 6 comments · Fixed by #3275 or #3294
Closed

Feature: Add support for Repo/Org Push rulesets #3274

srgustafson8 opened this issue Sep 20, 2024 · 6 comments · Fixed by #3275 or #3294
Assignees

Comments

@srgustafson8
Copy link
Contributor

GitHub launched push rules for rulesets to GA recently where you can allow only a certain team or group to push particular paths or files. The API has documentation now to support push rule targets for both Repository and Organisation.

It would be great to be able to support creating and managing these programatically.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 20, 2024

Yes, this is already supported, by setting the Ruleset.Target field to "push".

However, I've made #3275 to update the comment to make this more clear.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 20, 2024

Please let me know if I've missed something, @srgustafson8 .

@srgustafson8
Copy link
Contributor Author

@gmlewis thank you - I should have looked a bit deeper. Great to see this is already supported!

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 20, 2024

@gmlewis thank you - I should have looked a bit deeper. Great to see this is already supported!

No worries! It is also great to have the comments up-to-date to make things easier to find, so thank you for reporting the issue.

@srgustafson8
Copy link
Contributor Author

Hi @gmlewis - having done a bit more digging, I believe there is some work required to fully support the push rulesets. The target can be set to push already, but I see #3233 was needed to implement support for Restrict file paths rules. There are three other push ruleset rule types that would be good to support, Restrict file path length, Restrict file extensions and Restrict file size.

If you agree and this gets reopened, then I'm happy to give this a go when I get a chance.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 23, 2024

If you agree and this gets reopened, then I'm happy to give this a go when I get a chance.

Thank you, @srgustafson8 !
It's yours.

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