Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions github/resource_github_team_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ func resourceGithubTeamRepository() *schema.Resource {
ForceNew: true,
},
"permission": {
Type: schema.TypeString,
Optional: true,
Default: "pull",
ValidateFunc: validateValueFunc([]string{"pull", "triage", "push", "maintain", "admin"}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the reason for removing the validation to allow all custom role names?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's it. GitHub itself would handle whether the role exists going forward

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to pull all possible roles from GitHub and then validate against that?

Type: schema.TypeString,
Optional: true,
Default: "pull",
},
"etag": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/team_repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The following arguments are supported:
* `team_id` - (Required) The GitHub team id or the GitHub team slug
* `repository` - (Required) The repository to add to the team.
* `permission` - (Optional) The permissions of team members regarding the repository.
Must be one of `pull`, `triage`, `push`, `maintain`, or `admin`. Defaults to `pull`.
Must be one of `pull`, `triage`, `push`, `maintain`, `admin` or the name of an existing [custom repository role](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization) within the organisation. Defaults to `pull`.


## Import
Expand Down