Trying to use the GitHub Provider in TS to create ...
# typescript
t
Trying to use the GitHub Provider in TS to create a Repository environment and some secrets, but I see consistent failures like.. "stderr: error: PUT <https://api.github.com/repos/&lt;your%20org&gt;/accounts/environments/development%7Chttps://api.github.com/repos/&lt;your org>/accounts/environments/development>: 422 Fail to create protected rule, please ensure billing plan include protected branch gate. []" I tried with an access token with all assigned scopes and received the same results. The Environment as well a a subset of my desired secrets is created successfully. I am able to manually change the branch rules for the environment. Can I get some assistance or pointed to the implementation so I can potentially fix?
b
@thousands-psychiatrist-31710 looks to be a problem on the github side? https://github.com/orgs/community/discussions/30201
t
Potentially, was trying to narrow it down myself and determine what endpoints were ultimately being called by Pulumi to repro on my end.
Seems like github provider is using Terraform under the hood, found this relevant issue. It proposes manually setting the branch protection rules and importing state, the Pulumi analog of refresh is not detecting the update branch protection rules leading to apply to still try and set them resulting in the 422. https://github.com/integrations/terraform-provider-github/issues/1262