terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

Add support for specifying repo owner for branches

Open icco opened this issue 2 years ago • 1 comments

Currently, if you are a collaborator on a private repo, you can not get access to the branch.

For example:

if my user icco is a collaborator on cloudwalking's repo, and we are using my PAT, this returns no branch:

data "github_repository" "repo" {
  full_name = "cloudwalking/candygrams.xyz"
}

data "github_branch" "main" {
  repository = data.github_repository.repo.name
  branch     = "main"
}

This changes the above to allow passing in a repository owner:

data "github_branch" "main" {
  repository = data.github_repository.repo.name
  repository_owner = split("/", data.github_repository.repo.full_name)[1]
  branch     = "main"
}

icco avatar Jan 07 '22 14:01 icco

I don't understand the test code, so not entirely sure how to write tests for this new functionality.

icco avatar Jan 07 '22 14:01 icco

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

nickfloyd avatar Nov 30 '22 16:11 nickfloyd

👋 Hey Friends, this pull request has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Aug 29 '23 01:08 github-actions[bot]