setup-goに新しいバージョンが配布されたかどうかを調べる
This content is a draft and will not be included in production builds.
actions/setup-go で利用可能なGoのバージョンはactions/go-versionsのversions-manifest.jsonで管理されている。
ソースコードでは、installer.tsに
import * as tc from '@actions/tool-cache';
export async function getManifest(auth: string | undefined) { return tc.getManifestFromRepo('actions', 'go-versions', auth, 'main');}とあって、実態はactions/toolkit | tool-cache.ts:589:594以下にある(一部抜粋)。
const http: httpm.HttpClient = new httpm.HttpClient('tool-cache')for (const item of response.result.tree) { if (item.path === 'versions-manifest.json') { manifestUrl = item.url break }}let versionsRaw = await (await http.get(manifestUrl, headers)).readBody()なので、actions/go-versionsのReleasesに該当バージョンがあれば、たぶん使えるはずだが。
consider automating go-versions availability (auto go-versions update when released are done by the go team)で、Go公式に新しいバージョンが公開されたら利用できるようにしたい話題があるけれど、あまり進んでいる様子はない。