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

Update resource for repository file: make the branch default consistent with GitHub API

Open galargh opened this issue 3 years ago • 0 comments

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

galargh avatar Apr 28 '22 13:04 galargh