Skip to content
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

github_repository needs to not fail if repository doesn't exist #933

Closed
ronmpatel opened this issue Oct 8, 2021 · 0 comments · Fixed by #1031
Closed

github_repository needs to not fail if repository doesn't exist #933

ronmpatel opened this issue Oct 8, 2021 · 0 comments · Fixed by #1031
Labels
d/repository Type: Bug Something isn't working as documented

Comments

@ronmpatel
Copy link

Affected Resource(s)
github_repository

For a new repository the following will fail the entire plan/apply. It would be nice if we return null so that we could use that to conditionally check if repository exist or not.

Our use case is to create the repository only if does not exist.

Terraform Configuration Files
data "github_repository" "existing_repository" {
  full_name   = "${var.github_org}/${var.repo}"
}

Error Output
GET https://api.github.com/repos// 404 Not Found []

Reference
We have this for branch here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d/repository Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants