terraform-provider-github
terraform-provider-github copied to clipboard
Update resource for repository file: make the branch default consistent with GitHub API
Resolves #1132
Description
This PR updates the resource for repository files.
It changes the default value for branch argument from main to the name of the default branch of the requested repository. The new behaviour is how GitHub API itself behaves.
I also added a new attribute ref which, after apply, holds the name of the branch the file is associated with. In practice, if a branch was explicitly provided, then ref = branch. Otherwise, ref = the name of the default branch of the requested repository.
I updated the markdown entry which describes how to configure the resource.
Testing
- [x]
TF_ACC=1 go test -v ./... -run ^TestAccGithubRepositoryFile