Repository navigation
Open
Copy link
Labels
Milestone
Description
Expected Behavior
github_actions_hosted_runner resources should be importable without requiring any destructive replacements.
Actual Behavior
When importing github_actions_hosted_runner resources, the imported state does not include the image block. Since the resource treats this as an immutable field, this causes Terraform to plan a destroy + recreation of the hosted runner.
Terraform Version
Terraform v1.15.2
on darwin_arm64
- provider registry.terraform.io/integrations/github v6.12.1
Affected Resource(s)
- github_actions_hosted_runner
Terraform Configuration Files
terraform {
required_providers {
github = {
source = "integrations/github"
version = "~> 6"
}
}
}
provider "github" {
owner = "my-example-org"
}
import {
to = github_actions_hosted_runner.my_example_runner
id = "1"
}
resource "github_actions_hosted_runner" "my_example_runner" {
image_gen = false
image_version = null
maximum_runners = 50
name = "my-example-runner"
public_ip_enabled = false
runner_group_id = 1
size = "2-core"
image {
id = "2306"
source = "github"
}
}Steps to Reproduce
- In an enterprise organization, create a new GitHub-hosted runner in the Default runner group called
my-example-runner. Use all the default values:- Platform:
Linux x64 - Size:
2-cores - Image name:
Ubuntu Latest (24.04)
- Platform:
- Retrieve the runner ID from the URL (e.g.
https://github.com/organizations/my-example-org/settings/actions/github-hosted-runners/1->1) - Import the resource using an
importblock - Run the Terraform plan:
terraform planResult: Terraform wants to replace the runner
Terraform will perform the following actions:
# github_actions_hosted_runner.my_example_runner must be replaced
# (imported from "1")
# Warning: this will destroy the imported resource
-/+ resource "github_actions_hosted_runner" "my_example_runner" {
~ id = "1" -> (known after apply)
image_gen = false
~ last_active_on = "2026-05-06T16:27:22.8271735Z" -> (known after apply)
~ machine_size_details = [
- {
- cpu_cores = 2
- id = "2-core"
- memory_gb = 8
- storage_gb = 75
},
] -> (known after apply)
maximum_runners = 50
name = "my-example-runner"
~ platform = "linux-x64" -> (known after apply)
public_ip_enabled = false
~ public_ips = [] -> (known after apply)
runner_group_id = 1
size = "2-core"
~ status = "Ready" -> (known after apply)
+ image { # forces replacement
+ id = "2306"
+ size_gb = (known after apply)
+ source = "github"
}
}
Plan: 1 to import, 1 to add, 0 to change, 1 to destroy.
Debug Output
Panic Output
Code of Conduct
- I agree to follow this project's Code of Conduct
Reacted by Doug Murphy, Jeremy Blackowiak, Johannes Grumböck, Matt Copperwaite and Jarryd
Activity
github-actions commentedon May 6, 2026
👋 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
Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀robert-crandall commentedon Nov 26, 2026
Noting #3732 here as well, which calls out the root cause (
imagevsimage_detailsin the REST API response).