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

Add branches attribute to github_repository #892

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

mikeroll
Copy link
Contributor

Addresses #748.

Adding branches to both the resource and the data source.

@jcudit jcudit added this to the v4.15.0 milestone Aug 31, 2021
Copy link
Contributor

@jcudit jcudit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a test added or modified to incorporate the new field? Otherwise looks 👌🏾 with the docs update and implementation!

@mikeroll
Copy link
Contributor Author

mikeroll commented Sep 1, 2021

@jcudit I've only seen tests around for more advanced stuff like resource modification and nontrivial logic, so I figured we don't normally test simple things like this. I'll have another look though!

Copy link
Contributor

@jcudit jcudit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after verifying locally:

STATE:

data.github_repository.test:
  ID = tf-acc-hgsf1
  provider = provider.github
  allow_merge_commit = true
  allow_rebase_merge = true
  allow_squash_merge = true
  archived = false
  branches.# = 1
  branches.0.name = main
  branches.0.protected = false

@jcudit jcudit merged commit 62c46be into integrations:main Sep 22, 2021
@mikeroll
Copy link
Contributor Author

Thank you for finalising this, I got distracted by other things unfortunately.

@tobiassjosten
Copy link
Contributor

Is this released? It's in the documentation but I'm getting an error when trying to use it just now (Terraform v1.0.3 and integrations/terraform-provider-github v4.17.0):

╷
│ Error: Unsupported attribute
│
│   on asdf.tf line 41, in resource "github_branch_default" "asdf":
│   41:   count      = min(1, length(github_repository.asdf.branches))
│
│ This object has no argument, nested block, or exported attribute named "branches".
╵

muru added a commit to muru/terraform-provider-github that referenced this pull request Oct 28, 2021
In integrations#892, the newly-added `branches` attribute was exported for the data
source, but not the resource. This exports `branches` in the resource
too.
jcudit pushed a commit that referenced this pull request Dec 3, 2021
In #892, the newly-added `branches` attribute was exported for the data
source, but not the resource. This exports `branches` in the resource
too.
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
In integrations#892, the newly-added `branches` attribute was exported for the data
source, but not the resource. This exports `branches` in the resource
too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants