Skip to content

Commit

Permalink
feat: allow_update_branch argument
Browse files Browse the repository at this point in the history
setting allows toggling "always suggest updating pull request branch"
repository setting

Signed-off-by: Sean Trantalis <strantalis@virtru.com>
  • Loading branch information
strantalis committed Sep 19, 2022
1 parent 06054eb commit d21bba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ func resourceGithubRepository() *schema.Resource {
Type: schema.TypeInt,
Computed: true,
},
"allow_update_branch": {
Type: schema.TypeBool,
Optional: true,
},
},
}
}
Expand Down Expand Up @@ -309,6 +313,7 @@ func resourceGithubRepositoryObject(d *schema.ResourceData) *github.Repository {
GitignoreTemplate: github.String(d.Get("gitignore_template").(string)),
Archived: github.Bool(d.Get("archived").(bool)),
Topics: expandStringList(d.Get("topics").(*schema.Set).List()),
AllowUpdateBranch: github.Bool(d.Get("allow_update_branch").(bool)),
}
}

Expand Down Expand Up @@ -465,6 +470,7 @@ func resourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) erro
d.Set("topics", flattenStringList(repo.Topics))
d.Set("node_id", repo.GetNodeID())
d.Set("repo_id", repo.GetID())
d.Set("allow_update_branch", repo.GetAllowUpdateBranch())

if repo.GetHasPages() {
pages, _, err := client.Repositories.GetPagesInfo(ctx, owner, repoName)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ initial repository creation and create the target branch inside of the repositor

* `ignore_vulnerability_alerts_during_read` (Optional) - Set to `true` to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read.

* `allow_update_branch` (Optional) - Set to `true` to always suggest updating pull request branches.

### GitHub Pages Configuration

The `pages` block supports the following:
Expand Down

0 comments on commit d21bba0

Please sign in to comment.