Skip to content

Add branches attribute to github_repository - #892

Merged
jcudit merged 1 commit into
integrations:mainfrom
mikeroll:repository_branches
Sep 22, 2021
Merged

jcudit merged 1 commit into
integrations:mainfrom
mikeroll:repository_branches

Conversation

@mikeroll

Copy link
Copy Markdown
Contributor

Addresses #748.

Adding branches to both the resource and the data source.

@mikeroll
mikeroll force-pushed the repository_branches branch from a5fdcfa to 648dde7 Compare August 27, 2021 14:17
@mikeroll
mikeroll force-pushed the repository_branches branch from 648dde7 to 740899b Compare August 27, 2021 14:17
@jcudit jcudit added this to the v4.15.0 milestone Aug 31, 2021

@jcudit jcudit left a comment

Copy link
Copy Markdown
Contributor

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

mikeroll commented Sep 1, 2021

Copy link
Copy Markdown
Contributor Author

@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!

@jcudit jcudit left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@tobiassjosten

Copy link
Copy Markdown
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