-
Notifications
You must be signed in to change notification settings - Fork 763
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
[BUG] Creating environments from terraform crashes #1818
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
@clemenstan the permissions you need are given here:
|
Sorry, I haven't seen your post. Thank you for the hint! It still doesn't work. It really seem like a bug as mentioned here. |
+1 on this. I'm configuring the provider via a GitHub App which has write permissions over repositories, as well as environments. In some cases, it seems the API request actually successfully applies on the remote resource - but is not stored in state (which seems even more dangerous than complete failure). Initially I thought this may be because the teams I was hoping to configure were had Additionally, once this phantom environment is created, I cannot import it via the normal means
|
I wanted to create environments via terraform-provider-github_v5.36.0.
Update: adding a wait_timer, I get the following
|
We are also facing a similar issue (SIGSEGV) |
This seems to still be an issue in 5.38.0. |
We dug a bit further, and it seems to be an issue with the token used. A token with a lot of permissions works perfectly. Strangely enough, even with the limited access token we were using, the environment would get created, but the provider would fail to read it. I'll update this message once we identify the exact permissions we need. |
Knowing that the issue is a permission issue, since a classic PAT with full permissions works perfectly as @j-martin mentioned, I dug a bit deeper into this. In our case, the missing permission was Which, as per the docs here, includes the permission for the It seems the error handling here is broken, as this permission issue should be caught and returned to the user instead of the panic. |
Fixed in Provider returns:
|
Erratum : I finally can use the ".github_repository_environment.environment" by adding the
|
I would be good if the error message pointed to the missing permission. Anyone know what it is for
in addition to those already there:
what else does it need? |
Turns out nothing worked, it needs an app token: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow |
Hello,
I am trying to run terraform in a github workflow and using a "github app" instead with a personal access token for authorization. The github app works in general fine, but when I try to create repository environments with terraform, the provider crashes.
This is the terraform code, which crashes:
and I get the following error (please see below). It might be a permission issues, but I have a hard time to find out, what permission set I have to use?
Thanks for any help!
The text was updated successfully, but these errors were encountered: