integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
905 stars 746 forks source link

[FEAT]: GitHub App creation via terraform #2389

Open alexvanderberkel opened 1 month ago

alexvanderberkel commented 1 month ago

Describe the need

Hi all,

thanks for the splendid work on this terraform provider so far :-)

The terraform provider currently does not allow / lacking the feature of creating of GitHub apps. The provider should be capable of creating GitHub apps in the selected GitHub organization and as such reduce the manual effort to create GitHub Apps but rather use automation for this kind of behavior.

This would help to manage the number of apps installed in an organization.

If possible it would be nice if the permission of the GitHub app on different repositories can be set, e.g. read on repo a, write on repo B.

Currently, only the following is possible: https://registry.terraform.io/providers/integrations/github/latest/docs/resources/app_installation_repositories

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

nickfloyd commented 1 month ago

Hey @alexvanderberkel,

Thanks for reaching out. Since there are APIs available to help users manage Apps this should be a doable thing. Is this something that you'd be interested in implementing?

I've added the up for grabs label just in case someone from the community is interested in doing it as well. Thank you for bringing this up - it seems like it would be a great addition!

alexvanderberkel commented 1 month ago

So far I have not written any code for a provider yet.

srgustafson8 commented 1 month ago

Came across this when creating another issue - we have investigated this and concluded it's not possible to have a fully hands-off app creation experience. The only App creation API that exists is create from manifest which is a subset of the whole app manifest flow. This involves redirecting between sites in a browser, calling that API with a code returned and user credentials to create/install the app.

Best we could do was a static webpage where a user could click a few buttons to create the App via manifest and install it on the organisation, then download the id and key. Hoping to be proven wrong, but fully automated API driven org app creation doesn't seem possible.

alexvanderberkel commented 1 month ago

That does not sound to promising.