Skip to content

feat: Add custom image endpoints for GitHub-hosted runners#4101

Merged
gmlewis merged 5 commits intogoogle:masterfrom
austenstone:add-custom-image-endpoints
Mar 19, 2026
Merged

feat: Add custom image endpoints for GitHub-hosted runners#4101
gmlewis merged 5 commits intogoogle:masterfrom
austenstone:add-custom-image-endpoints

Conversation

@austenstone
Copy link
Contributor

Summary

Add 6 new endpoints for managing custom images on GitHub-hosted runners, for both organization and enterprise levels.

New Endpoints

Organization (ActionsService)

Method HTTP Path
ListHostedRunnerCustomImages GET /orgs/{org}/actions/hosted-runners/images/custom
GetHostedRunnerCustomImage GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}
DeleteHostedRunnerCustomImage DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}
ListHostedRunnerCustomImageVersions GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions
GetHostedRunnerCustomImageVersion GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}
DeleteHostedRunnerCustomImageVersion DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}

Enterprise (EnterpriseService)

Same 6 endpoints under /enterprises/{enterprise}/...

New Types

  • HostedRunnerCustomImage — custom image definition (id, platform, name, source, versions_count, total_versions_size, latest_version, state)
  • HostedRunnerCustomImages — list wrapper
  • HostedRunnerCustomImageVersion — image version (version, size_gb, state, created_on)
  • HostedRunnerCustomImageVersions — list wrapper

API Docs

https://docs.github.com/en/rest/actions/hosted-runners?apiVersion=2026-03-10

austenstone added a commit to austenstone/terraform-provider-github that referenced this pull request Mar 16, 2026
Add three new data sources for managing custom images on GitHub-hosted runners:

- github_actions_hosted_runner_custom_images: List all custom images for an org
- github_actions_hosted_runner_custom_image: Get a single custom image definition
- github_actions_hosted_runner_custom_image_versions: List versions of a custom image

WIP: Blocked on google/go-github#4101 merging. Currently uses raw HTTP calls
via the v3client to avoid a go-github version bump. Once the go-github PR
lands and is released, these can be migrated to typed SDK methods.

Includes acceptance tests, provider registration, and website docs.
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.71%. Comparing base (acab708) to head (a547cae).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4101      +/-   ##
==========================================
+ Coverage   93.68%   93.71%   +0.03%     
==========================================
  Files         211      211              
  Lines       19510    19614     +104     
==========================================
+ Hits        18278    18382     +104     
  Misses       1034     1034              
  Partials      198      198              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis changed the title Add custom image endpoints for GitHub-hosted runners feat: Add custom image endpoints for GitHub-hosted runners Mar 17, 2026
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. labels Mar 17, 2026
@gmlewis
Copy link
Collaborator

gmlewis commented Mar 17, 2026

@austenstone - this one needs a linter cleanup before proceeding.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @austenstone!
Just a few tweaks, please, then awaiting a second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

@munlicode
Copy link
Contributor

LGTM

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @austenstone, @Not-Dhananjay-Mishra, and @munlicode!
LGTM.

@Not-Dhananjay-Mishra - do you approve now?

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Mar 17, 2026
Copy link
Contributor

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small suggestion, otherwise LGMT 🚀

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as @Not-Dhananjay-Mishra, the structs need aligning to the required API fields (remove pointer & omitempty where field is always returned).

Add 6 new endpoints for managing custom images on GitHub-hosted runners,
for both organization and enterprise levels:

- ListHostedRunnerCustomImages: GET .../hosted-runners/images/custom
- GetHostedRunnerCustomImage: GET .../hosted-runners/images/custom/{id}
- DeleteHostedRunnerCustomImage: DELETE .../hosted-runners/images/custom/{id}
- ListHostedRunnerCustomImageVersions: GET .../hosted-runners/images/custom/{id}/versions
- GetHostedRunnerCustomImageVersion: GET .../hosted-runners/images/custom/{id}/versions/{ver}
- DeleteHostedRunnerCustomImageVersion: DELETE .../hosted-runners/images/custom/{id}/versions/{ver}

New types: HostedRunnerCustomImage, HostedRunnerCustomImages,
HostedRunnerCustomImageVersion, HostedRunnerCustomImageVersions

Fixes #XXXX
…ustomImages not HostedRunnerCustomImageVersions
All fields in HostedRunnerCustomImage and HostedRunnerCustomImageVersion
are marked as required in the API schema, so they should be non-pointer
types without omitempty.
@austenstone austenstone force-pushed the add-custom-image-endpoints branch from e8a20cb to a547cae Compare March 19, 2026 17:53
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. and removed waiting for reply labels Mar 19, 2026
@gmlewis
Copy link
Collaborator

gmlewis commented Mar 19, 2026

Thank you, @austenstone!
@stevehipwell and @Not-Dhananjay-Mishra - do you approve these changes since you both reviewed?

Copy link
Contributor

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 19, 2026

Thank you, @stevehipwell and @Not-Dhananjay-Mishra!
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Mar 19, 2026
@gmlewis gmlewis merged commit a12b8d7 into google:master Mar 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants