Open audunsolemdal opened 8 months ago
@audunsolemdal this is an API behavior, not the Terraform provider, though we could certainly stand to document it better here. The API docs say:
You must use a personal access token (which you can create via the command line or Basic Authentication) to access this endpoint.
I am aware that Github apps cannot use this endpoint, but I am using a personal access token. "Fine-grained". I do not think the sentence you refer to in docs directly covers this.
Ahh you're right, I've misread, sorry. It still is an API issue, however: fine-grained tokens support only limited Apps endpoints.
Hey there, wanted to bump this.
This endpoint's documentation is super frustrating because it explicitly says all the ways you can't authenticate to the endpoint, but makes no mention of how you can actually use the endpoint.
Additionally the current docs for the provider resource make no mention of any of these constraints. Anybody know if it's actually possible to manage app installations on repos through TF right now? I would assume yes since there's a resource for it... but I can't figure it out. Thanks in advance!
Good question @brett-swan-sh ! Bumping this as well, as managing GitHub Apps with Terraform would be highly useful.
Expected Behavior
Managing github app installations should work fine with fine-grained Github tokens
Actual Behavior
Fine-grained Github tokens do not work with managing app installations. Running Terraform plan works fine if the resource does not already exist, but fails with
403 Resource not accessible by personal access token []
onterraform apply
. If the resource is already in terraform state the403
error is returned when runningterraform plan
The same resources work fine with a classic PAT with org:read and repo:write permissions. It is not clear to me if the fine-grained tokens supports generating a user access token , or if the terraform provider needs an update.
Terraform Version
Terraform v1.6.6 on windows_amd64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
Debug Output
Panic Output
No response
Code of Conduct