[FEAT]: github_collaborators data_source should allow filtering based on permission #2381
Closed
1 task done
Labels
Type: Feature
New feature or request
Describe the need
Currently the
github_collaborators
data_source always returns all users that have access to the repo (unless you filter onaffiliation
, see last paragraph for limitation on that). This becomes a problem in large organizations with many users and some permission (like read) being granted to all repos by default. The result is that any call to this datasource have to list all the users in the entire organization, taking quite a long time.The underlying API endpoint
/repos/OWNER/REPO/collaborators
supports filtering viapermission
, but the Terraform data source does not. This is what this issue is for!The underlying
go-github
SDK already support this, so the change in this repo would be pretty straight forward.Note that it is currently possible to filter on
affiliation
in the data source, but this is quite limited. You can only get:outside
- All outside collaborators with access to the repodirect
- All users which have direct access to the repo (notably this does not include users with access to the repo via a team assignment)all
- Every user with any access to the repoSDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: