terraform-provider-github
terraform-provider-github copied to clipboard
Add support for specifying repo owner for branches
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"
}
I don't understand the test code, so not entirely sure how to write tests for this new functionality.
👋 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!
👋 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!