terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[FEAT]: Support Push Rulesets

Open srgustafson8 opened this issue 1 year ago • 14 comments

Describe the need

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 appears to support push rule targets for both Repository and Organisation.

It would be great to be able to support creating and managing these with terraform. This is depends on https://github.com/google/go-github/issues/3274 adding support in the SDK.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

srgustafson8 avatar Sep 20 '24 10:09 srgustafson8

Was this ever released https://github.com/integrations/terraform-provider-github/pull/2351?

akmalharith avatar Sep 27 '24 08:09 akmalharith

@akmalharith I was wrong in my original assessment, support for push existed in the SDK but not for 3/4 of the rule types for push rules. I have opened a PR to add them to the SDK then will pick this up once merged and upgraded.

srgustafson8 avatar Sep 27 '24 08:09 srgustafson8

@akmalharith FWIW #2351 was released as part of v6.3.0.

kfcampbell avatar Sep 27 '24 18:09 kfcampbell

https://github.com/google/go-github/issues/3274 is part of the version v66.0.0 which is now released. I have created https://github.com/integrations/terraform-provider-github/issues/2419.

TheArtheist avatar Oct 10 '24 12:10 TheArtheist

Would be awesome to get this merged in!

kieran-lowe avatar Oct 21 '24 18:10 kieran-lowe

While go-github is now updated to v66.0.0, changes are still required in github/resource_github_organization_ruleset.go and github/resource_github_repository_ruleset.go (at least).

Rules such as max_file_size and file_path_restriction need to be added.

There seems to be other work in progress, such as #2415 for file_path_restriction, but that is for repository rulesets.

jimsheldon avatar Nov 25 '24 15:11 jimsheldon

@jimsheldon have you requested this be covered as part of #2415?

stevehipwell avatar Nov 25 '24 16:11 stevehipwell

@jimsheldon @stevehipwell I have added the max_file_size restriction to #2415. As I do not have admin access to an organisation with paid features I am uncomfortable adding features I can't test.

grahamhar avatar Dec 02 '24 13:12 grahamhar

Any update on when push restrictions will be added? Specifically looking for the file type restriction, and as of v6.4.0 seems there is still no push support, at least according to the docs.

adrian-85 avatar Dec 19 '24 17:12 adrian-85

@adrian-85 I have added this to the PR related #2415 for you, I don't need this feature myself which is why I didn't add it originally. Please upvote the PR to help get it reviewed.

grahamhar avatar Dec 22 '24 11:12 grahamhar

I added a thumbs up to your last comment in the PR conversation, is that what you meant by upvote?

adrian-85 avatar Jan 06 '25 16:01 adrian-85

Hi Team any update on this

arun-i-gilead avatar Mar 19 '25 11:03 arun-i-gilead

This is a most wanted feature on our side

EricDales avatar Apr 01 '25 15:04 EricDales

Hi Team, any update on this feature? It's been a long-awaited feature.

Adarsh1999 avatar May 14 '25 16:05 Adarsh1999

Any updates?

Coalery avatar Jun 27 '25 05:06 Coalery