integrations / integrations/terraform-provider-github
[FEAT]: Allow configuring runner group repository access from multiple resources independently
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 8
Description
### Describe the need
Currently the only way to control which repositories have access to a specific runner group is via the central runner group resource `github_actions_runner_group`/`github_enterprise_actions_runner_group`, which manages the list of all repositories that have access to the runner group.
In many cases, especially surrounding building Internal Development Platforms which create managed repositories as needed, it is not desirable to centralize the list of repositories in a central state and rather allow independent, potentially concurrent deployment processes to add/remove a specific repository.
The relevant API Endpoints to add/remove single repos [have existed since at least the first API Version `2022-11-28`](https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions-next/ghes-3.20/ghes-3.20.2022-11-28.yaml#:~:text=operationId%3A%20actions%2Fadd%2Drepo%2Daccess%2Dto%2Dself%2Dhosted%2Drunner%2Dgroup%2Din%2Dorg) and should therefore be available in all versions of the octokit sdk.
Example of how the new resource could look like
```hcl
resource "github_actions_runner_group_repository_access" "example" {
runner_group_id = 12345
repository_id = 3256
}
```
Note that apparently [the enterprise runner group resource returns its id](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/enterprise_actions_runner_group#id-8) but [the org runner group resource doesn't](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_runner_group#attributes-reference) although this is not a blocker, but a separate DX problem, since the id can still be extracted from the urls returned in the attributes
Edit: This seems to be an oversight in the manually created docs, the id attribute is accessible
### SDK Version
_No response_
### API Version
_No response_
### Relevant log output
_n/a_
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.