mirror of
https://github.com/actions/setup-go.git
synced 2026-04-06 12:49:24 +00:00
fix bug in JSON with custom URL
This commit is contained in:
parent
9142921940
commit
0980fb1938
3 changed files with 21 additions and 6 deletions
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
|
|
@ -77383,7 +77383,10 @@ function getInfoFromManifest(versionSpec_1, stable_1, auth_1) {
|
|||
}
|
||||
function getInfoFromDist(versionSpec, arch, goDownloadBaseUrl) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const version = yield findMatch(versionSpec, arch);
|
||||
const dlUrl = goDownloadBaseUrl
|
||||
? `${goDownloadBaseUrl}/?mode=json&include=all`
|
||||
: GOLANG_DOWNLOAD_URL;
|
||||
const version = yield findMatch(versionSpec, arch, dlUrl);
|
||||
if (!version) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -77421,12 +77424,12 @@ function getInfoFromDirectDownload(versionSpec, arch, goDownloadBaseUrl) {
|
|||
};
|
||||
}
|
||||
function findMatch(versionSpec_1) {
|
||||
return __awaiter(this, arguments, void 0, function* (versionSpec, arch = os_1.default.arch()) {
|
||||
return __awaiter(this, arguments, void 0, function* (versionSpec, arch = os_1.default.arch(), dlUrl = GOLANG_DOWNLOAD_URL) {
|
||||
const archFilter = sys.getArch(arch);
|
||||
const platFilter = sys.getPlatform();
|
||||
let result;
|
||||
let match;
|
||||
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
|
||||
const candidates = yield module.exports.getVersionsDist(dlUrl);
|
||||
if (!candidates) {
|
||||
throw new Error(`golang download url did not return results`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue