Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Status: StaleUsed by stalebot to clean houseStatus: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documented
Description
Expected Behavior
The github_repository_file should have been created within the provided organisation repository. Interesrtingly in the debug logs I can see that the organisation name isn't being sent through in the request. The owner field seems to be ignored. When creating a direct github_repository_file resource without utilising a module this works without an issue.
Actual Behavior
Error received. Error: unexpected status code: 404 Not Found
Terraform Version
1.6.6
Affected Resource(s)
- github_repository_file
Terraform Configuration Files
### Provider Config ###
terraform {
required_providers {
github = {
source = "integrations/github"
version = "~> 5.0"
}
}
}
provider "github" {
owner = "orgName"
}
### Module ###
resource "github_repository_file" "main-template" {
repository = var.repository
branch = var.branch
file = var.file
content = var.content
commit_message = var.commit_message
commit_author = var.commit_author
commit_email = var.commit_email
overwrite_on_create = var.overwrite_on_create
}
module "file-to-create" {
source = "../../../modules/github/github-file-creation"
repository = "repoName"
branch = main
file = "filetocreate.txt"
content = "test"
}Steps to Reproduce
terraform plan
Debug Output
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: ---[ REQUEST ]---------------------------------------
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: GET /repos/otola/repoName/branches/develop HTTP/1.1
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: Host: api.github.com
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: User-Agent: go-github/v55.0.0
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: Accept: application/vnd.github.v3+json,application/vnd.github.stone-crop-preview+json
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: X-Github-Api-Version: 2022-11-28
2023-12-19T17:23:37.612Z [DEBUG] provider.terraform-provider-github_v5.42.0: Accept-Encoding: gzipPanic Output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: StaleUsed by stalebot to clean houseStatus: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documented
Type
Projects
- StatusShow more project fields✅ Done
Activity
kfcampbell commentedon Jan 5, 2024
If you're using separate modules and the org name isn't being sent, you need to follow the directions in our docs here:
github-actions commentedon Oct 2, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!