Fix github_actions_hosted_runner import of the image block#3406
Open
terrabitz wants to merge 4 commits into
Open
Fix github_actions_hosted_runner import of the image block#3406terrabitz wants to merge 4 commits into
github_actions_hosted_runner import of the image block#3406terrabitz wants to merge 4 commits into
Conversation
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.