feat: Add custom image endpoints for GitHub-hosted runners#4101
feat: Add custom image endpoints for GitHub-hosted runners#4101austenstone wants to merge 4 commits intogoogle:masterfrom
Conversation
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
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4101 +/- ##
==========================================
+ Coverage 93.67% 93.70% +0.03%
==========================================
Files 211 211
Lines 19478 19582 +104
==========================================
+ Hits 18246 18350 +104
Misses 1034 1034
Partials 198 198 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@austenstone - this one needs a linter cleanup before proceeding. |
gmlewis
left a comment
There was a problem hiding this comment.
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
|
LGTM |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @austenstone, @Not-Dhananjay-Mishra, and @munlicode!
LGTM.
@Not-Dhananjay-Mishra - do you approve now?
Not-Dhananjay-Mishra
left a comment
There was a problem hiding this comment.
Few small suggestion, otherwise LGMT 🚀
| type HostedRunnerCustomImageVersion struct { | ||
| Version *string `json:"version,omitempty"` | ||
| SizeGB *int `json:"size_gb,omitempty"` | ||
| State *string `json:"state,omitempty"` | ||
| StateDetails *string `json:"state_details,omitempty"` | ||
| CreatedOn *Timestamp `json:"created_on,omitempty"` |
There was a problem hiding this comment.
| type HostedRunnerCustomImageVersion struct { | |
| Version *string `json:"version,omitempty"` | |
| SizeGB *int `json:"size_gb,omitempty"` | |
| State *string `json:"state,omitempty"` | |
| StateDetails *string `json:"state_details,omitempty"` | |
| CreatedOn *Timestamp `json:"created_on,omitempty"` | |
| type HostedRunnerCustomImageVersion struct { | |
| Version string `json:"version"` | |
| SizeGB int `json:"size_gb"` | |
| State string `json:"state"` | |
| StateDetails string `json:"state_details"` | |
| CreatedOn Timestamp `json:"created_on"` |
Can we remove omitempty from required fields?
| ID *int64 `json:"id,omitempty"` | ||
| Platform *string `json:"platform,omitempty"` | ||
| Name *string `json:"name,omitempty"` | ||
| Source *string `json:"source,omitempty"` | ||
| VersionsCount *int `json:"versions_count,omitempty"` | ||
| TotalVersionsSize *int `json:"total_versions_size,omitempty"` | ||
| LatestVersion *string `json:"latest_version,omitempty"` | ||
| State *string `json:"state,omitempty"` |
There was a problem hiding this comment.
| ID *int64 `json:"id,omitempty"` | |
| Platform *string `json:"platform,omitempty"` | |
| Name *string `json:"name,omitempty"` | |
| Source *string `json:"source,omitempty"` | |
| VersionsCount *int `json:"versions_count,omitempty"` | |
| TotalVersionsSize *int `json:"total_versions_size,omitempty"` | |
| LatestVersion *string `json:"latest_version,omitempty"` | |
| State *string `json:"state,omitempty"` | |
| ID int64 `json:"id"` | |
| Platform string `json:"platform"` | |
| Name string `json:"name"` | |
| Source string `json:"source"` | |
| VersionsCount int `json:"versions_count"` | |
| TotalVersionsSize int `json:"total_versions_size"` | |
| LatestVersion string `json:"latest_version"` | |
| State string `json:"state"` |
same
Summary
Add 6 new endpoints for managing custom images on GitHub-hosted runners, for both organization and enterprise levels.
New Endpoints
Organization (
ActionsService)ListHostedRunnerCustomImages/orgs/{org}/actions/hosted-runners/images/customGetHostedRunnerCustomImage/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}DeleteHostedRunnerCustomImage/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}ListHostedRunnerCustomImageVersions/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versionsGetHostedRunnerCustomImageVersion/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}DeleteHostedRunnerCustomImageVersion/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 wrapperHostedRunnerCustomImageVersion— image version (version, size_gb, state, created_on)HostedRunnerCustomImageVersions— list wrapperAPI Docs
https://docs.github.com/en/rest/actions/hosted-runners?apiVersion=2026-03-10