[FEAT]: Add owner
attribute to github_repository
data source and resource
#2503
Labels
owner
attribute to github_repository
data source and resource
#2503
Describe the need
The
github_repository
data source works in two "modes": authenticated or anonymous.When authenticated, the owner can be implied from the current provider instance, so all that is needed to look up the repository is the
name
. Thefull_name
is populated in the<organization>/<name>
format.When anonymous, the owner cannot be implied, so the
full_name
must be used.name
is returned as the name portion of the full name.I propose adding an
Optional, Computed
owner
field to the data source. This could be used in the anonymous mode along withname
to specify the repository. Otherwise, it would be populated with the owner of the repository.This would also have the benefit of keeping all information about the repository contained within the data source object so that it could be used in e.g. a module. Currently, either the owner must be passed as a separate variable or the
full_name
must be split. This would make the owner a "first-class" field of the data source alongsidename
, rather than needing to derive it.For parity between the data source and the resource, also add
owner
as aComputed
field to the resource.For example, a module can take the resource or data source as an
object
value. The object will havefull_name
andname
as attributes, but if the owner is needed, it must either be passed separately or parsed fromfull_name
.Currently your module must be like either
or
If
owner
is added as a field, we could do the following:SDK 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: