[BUG]: `github_actions_runner_group` never refreshes `selected_repository_ids` when the group returns 304 (regression of #1310)
Expected Behavior
Refresh/plan should detect repositories added to or removed from a runner group outside Terraform (e.g. in the GitHub UI), as it did after #1435.
Actual Behavior
If the runner group itself is unchanged, the group GET returns 304 Not Modified for the etag stored in state, and Read returns early (L241) before it lists the group's repositories (L285).
The repository list isn't part of the runner group response (only selected_repositories_url is), so changing it doesn't change the group's etag. Out-of-band repository changes are therefore never detected for as long as the stored etag stays valid.
This is a regression of #1310:
- Fixed in #1435 (merged 2022-12-28, released in v5.13.0) by continuing past the 304 to list the repositories.
- Reintroduced in #1696 (merged 2023-05-24, released in v5.26.0), which fixed a nil-pointer panic from that change (#1524) by returning early on 304.
It has been present in every release since v5.26.0.
github_enterprise_actions_runner_group has the same pattern for selected_organization_ids (L222, L263). I haven't reproduced that one.
What we observed: two repositories were added to a runner group in the UI months ago. Our daily refresh --expect-no-changes reported no drift the whole time. It only surfaced after we rotated the provider token: etags vary by Authorization, so the stored etag stopped matching, the GET returned 200, and the repository list was finally read. State still lists the one configured repository.
Suggested fix
Always list the group's repositories in Read, even when the group GET returns 304. Alternatively, drop the legacy etag from these two resources, in line with the direction in #3103. Happy to open a PR for whichever approach you prefer.
Terraform Version
We hit this through Pulumi: pulumi-github v6.15.0, which bundles this provider at v6.13.0. The code path above is unchanged on main at 20f916c.
GitHub Installation Type
- [ ] GitHub.com (Free, Pro, or Team)
- [ ] GitHub Enterprise Server (on-premises)
- [x] GitHub Enterprise Cloud with Personal Accounts (github.com)
- [ ] GitHub Enterprise Cloud with Managed Users/EMU (github.com)
- [ ] GitHub Enterprise Cloud with Data Residency (*.ghe.com)
- [ ] I don't know
Affected Resource(s)
github_actions_runner_groupgithub_enterprise_actions_runner_group(same pattern, not reproduced)
Terraform Configuration Files
# Managed with Pulumi (github.ActionsRunnerGroup, which maps directly to
# this resource), not Terraform. Equivalent Terraform config:
resource "github_actions_runner_group" "large" {
name = "large"
visibility = "selected"
selected_repository_ids = [123]
}
Steps to Reproduce
- Apply the config above.
- In the GitHub UI, add another repository to the runner group.
terraform plan(orapply -refresh-only): no changes reported.- Change the provider token (or clear
etagfrom state) and plan again: the added repository now shows as drift.
Debug Output
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
👋 Hi, and thank you for opening this issue!
This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.
You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.
🤖 This is an automated message.