From d0c5defdf364f1d1fb07530c000084836192af9c Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 20 Jul 2020 19:50:40 +0300 Subject: [PATCH] Switch manifest installation from "master" to "main" branch (#65) * switch from master to main branch * Update README.md --- README.md | 2 ++ dist/index.js | 2 +- src/installer.ts | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37d3f0e72..5edad42f9 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ The V2 offers: - stable input - Bug Fixes (including issues around version matching and semver) +It will first check the local cache for a version match. If version is not found locally, It will pull it from `main` branch of [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository and on miss or failure, it will fall back to the previous behavior of download directly from [go dist](https://storage.googleapis.com/golang). + Matching by semver spec: ```yaml steps: diff --git a/dist/index.js b/dist/index.js index 2689cf38a..807fbb1e1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5034,7 +5034,7 @@ exports.extractGoArchive = extractGoArchive; function getInfoFromManifest(versionSpec, stable, auth) { return __awaiter(this, void 0, void 0, function* () { let info = null; - const releases = yield tc.getManifestFromRepo('actions', 'go-versions', auth); + const releases = yield tc.getManifestFromRepo('actions', 'go-versions', auth, "main"); core.info(`matching ${versionSpec}...`); const rel = yield tc.findFromManifest(versionSpec, stable, releases); if (rel && rel.files.length > 0) { diff --git a/src/installer.ts b/src/installer.ts index 08758a48c..0e0d5d399 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -140,7 +140,12 @@ export async function getInfoFromManifest( auth: string | undefined ): Promise { let info: IGoVersionInfo | null = null; - const releases = await tc.getManifestFromRepo('actions', 'go-versions', auth); + const releases = await tc.getManifestFromRepo( + 'actions', + 'go-versions', + auth, + 'main' + ); core.info(`matching ${versionSpec}...`); const rel = await tc.findFromManifest(versionSpec, stable, releases);