Skip to content

[BUG]: github_actions_hosted_runner resource must be replaced after import #3405

Description

@terrabitz

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

  1. 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)
  2. Retrieve the runner ID from the URL (e.g. https://github.com/organizations/my-example-org/settings/actions/github-hosted-runners/1 -> 1)
  3. Import the resource using an import block
  4. Run the Terraform plan:
terraform plan

Result: 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

Activity

  1. added
    Type: Bug
    Status: Triage
    on May 6, 2026
  2. github-actions commented on May 6, 2026

    @github-actions

    👋 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! 🚀

  3. self-assigned this
    on Jul 22, 2026
  4. removed
    Status: Triage
    on Jul 22, 2026
  5. added theissue type on Jul 22, 2026
  6. added this to the v6.14.0 milestone on Jul 22, 2026
  7. robert-crandall commented on Nov 26, 2026

    @robert-crandall
    Contributor

    Noting #3732 here as well, which calls out the root cause (image vs image_details in the REST API response).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bugr/actions_hosted_runner

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions