Fix github_actions_hosted_runner import of the image block#3406
Fix github_actions_hosted_runner import of the image block#3406terrabitz wants to merge 8 commits into
github_actions_hosted_runner import of the image block#3406Conversation
Signed-off-by: Trevor Taubitz <trevor.taubitz@flocksafety.com>
Signed-off-by: Trevor Taubitz <trevor.taubitz@flocksafety.com>
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
Thanks a lot for the PR! The resource needs A LOT of refactoring work, which I've done here This also includes your fix, though not the commit itself :/ |
Thanks for the fixes! I'm glad to see some investment into this resource, even if I don't get any street cred for it 😅 I'll go ahead and close this PR out. |
Resolves #3405
Before the change?
During imports, the
github_actions_hosted_runnerresource tried accessing incorrect JSON keys, resulting in theimageblock not being imported correctly. This in turn causes the resource to be replaced, since this is an immutable value:After the change?
The correct JSON keys are now used, and the resource imports correctly
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
I think this bug occurred because the GitHub documentation for the "get a hosted runner for an organization" endpoint lies.
Here is a example of what the output from the
/orgs/<org>/actions/hosted-runners/<id>endpoint looks like:{ "id": 8, "name": "my-example-runner", "image_details": { "id": "2306", "size_gb": 75, "display_name": "Ubuntu Latest (24.04)", "source": "github", "version": "latest" }, "platform": "linux-x64", "runner_group_id": 1, "maximum_runners": 50, "machine_size_details": { "id": "2-core", "cpu_cores": 2, "memory_gb": 8, "storage_gb": 75 }, "public_ip_enabled": false, "public_ips": [], "last_active_on": "2026-05-06T16:27:22.8271735Z", "status": "Ready", "image_gen": false }Notably, it does not contain a key called
image, but ratherimage_details. Also that block doesn't have asize, but rathersize_gbThis matches up with the listed schema but not the listed Example response. I wonder if GitHub changed their APIs and forgot to update the example.
Note
Note to reviewer, I wasn't able to run the integration tests locally because it requires an enterprise account to use this feature. And unfortunately I can't use my company's organization, since we don't have a dedicated organization for testing this. But I have tested the imports locally through a local provider override.