-
Notifications
You must be signed in to change notification settings - Fork 927
Open
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_file
Description
Terraform Version
= v1.0.5
Affected Resource(s)
github_repository_file
Terraform Configuration Files
resource "github_repository" "repos" {
for_each = local.repos
name = each.key
description = join("", [each.value.description, " - Managed by Terraform"])
visibility = each.value.visibility
homepage_url = each.value.homepage_url
}
resource "github_repository_file" "gitignore" {
for_each = local.repos
content = file("templates/.gitignore")
file = ".gitignore"
repository = github_repository.repos[each.key].name
branch = "main"
overwrite_on_create = true
commit_message = "Managed by Terraform"
commit_author = "user"
commit_email = "user@email.com"
}Expected Behavior
The repositories should be created, and a default .gitignore file should be created with contents from the given template file.
Actual Behavior
The repositories are created. The .gitignore file fails with the following error:
Error: unexpected status code: 404 Not Found
with github_repository_file.gitignore["terraform"],
on repos.tf line 10, in resource "github_repository_file" "gitignore":
10: resource "github_repository_file" "gitignore" {
This error is repeated 27 times, one for each repository.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
I am running this against my personal Github account.
My Github token has the following permissions:
- repo
- repo:status
- repo_deployment
- public_repo
- repo:invite
- security_events
meilz381, lerrigatto, one1zero1one, missinglink, alejandraRamos and 11 more
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_file
Type
Projects
Status
🔥 Backlog
Status
In Progress