mirror of
https://github.com/actions/setup-go.git
synced 2025-05-31 01:15:21 +00:00
Add manifest validation and improve error handling (#586)
Some checks failed
Check dist/ / Check dist/ (push) Failing after 2s
Basic validation / Basic validation (push) Failing after 3s
CodeQL analysis / CodeQL analysis (push) Failing after 3s
Licensed / Licensed (push) Failing after 4s
Validate 'setup-go' / oldstable (ubuntu-latest) (push) Successful in 27s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, oldstable) (push) Successful in 30s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, stable) (push) Successful in 17s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, stable) (push) Successful in 1m21s
Validate 'setup-go' / Setup local-cache version (1.22.8, ubuntu-latest) (push) Successful in 33s
Validate 'setup-go' / check-latest (1.22, ubuntu-latest) (push) Successful in 20s
Validate 'setup-go' / check-latest (1.23, ubuntu-latest) (push) Successful in 22s
Validate 'setup-go' / architecture (x64, 1.21, ubuntu-latest) (push) Has started running
Validate 'setup-go' / architecture (x64, 1.23, ubuntu-latest) (push) Failing after 14m3s
Validate 'setup-go' / architecture (x64, 1.22, ubuntu-latest) (push) Failing after 14m3s
Validate 'setup-go' / architecture (x64, 1.20.14, ubuntu-latest) (push) Failing after 14m4s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, ubuntu-latest) (push) Failing after 14m6s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, ubuntu-latest) (push) Failing after 14m6s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, ubuntu-latest) (push) Failing after 14m8s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, ubuntu-latest) (push) Failing after 14m8s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, ubuntu-latest) (push) Failing after 14m10s
Validate 'setup-go' / go-version-file-with-gowork (ubuntu-latest) (push) Failing after 14m11s
Validate 'setup-go' / go-version-file (ubuntu-latest) (push) Failing after 14m12s
Validate 'setup-go' / check-latest (1.21, ubuntu-latest) (push) Failing after 14m14s
Validate 'setup-go' / check-latest (1.20, ubuntu-latest) (push) Failing after 14m16s
Validate 'setup-go' / Setup local-cache version (1.23.2, ubuntu-latest) (push) Failing after 14m18s
Validate 'setup-go' / Setup local-cache version (1.21.13, ubuntu-latest) (push) Failing after 14m21s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, oldstable) (push) Failing after 14m23s
Validate 'setup-go' / stable (ubuntu-latest) (push) Failing after 14m27s
Validate 'setup-go' / stable (macos-13) (push) Has been cancelled
Validate 'setup-go' / stable (macos-latest) (push) Has been cancelled
Validate 'setup-go' / stable (windows-latest) (push) Has been cancelled
Validate 'setup-go' / oldstable (macos-13) (push) Has been cancelled
Validate 'setup-go' / oldstable (macos-latest) (push) Has been cancelled
Validate 'setup-go' / oldstable (windows-latest) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x32, windows-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x32, windows-latest, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-13, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-13, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-latest, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, windows-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, windows-latest, stable) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, windows-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file (macos-13) (push) Has been cancelled
Validate 'setup-go' / go-version-file (macos-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file (windows-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (macos-13) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (macos-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Has been cancelled
Validate Windows installation / Find default go version (push) Has been cancelled
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Has been cancelled
Some checks failed
Check dist/ / Check dist/ (push) Failing after 2s
Basic validation / Basic validation (push) Failing after 3s
CodeQL analysis / CodeQL analysis (push) Failing after 3s
Licensed / Licensed (push) Failing after 4s
Validate 'setup-go' / oldstable (ubuntu-latest) (push) Successful in 27s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, oldstable) (push) Successful in 30s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, stable) (push) Successful in 17s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, stable) (push) Successful in 1m21s
Validate 'setup-go' / Setup local-cache version (1.22.8, ubuntu-latest) (push) Successful in 33s
Validate 'setup-go' / check-latest (1.22, ubuntu-latest) (push) Successful in 20s
Validate 'setup-go' / check-latest (1.23, ubuntu-latest) (push) Successful in 22s
Validate 'setup-go' / architecture (x64, 1.21, ubuntu-latest) (push) Has started running
Validate 'setup-go' / architecture (x64, 1.23, ubuntu-latest) (push) Failing after 14m3s
Validate 'setup-go' / architecture (x64, 1.22, ubuntu-latest) (push) Failing after 14m3s
Validate 'setup-go' / architecture (x64, 1.20.14, ubuntu-latest) (push) Failing after 14m4s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, ubuntu-latest) (push) Failing after 14m6s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, ubuntu-latest) (push) Failing after 14m6s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, ubuntu-latest) (push) Failing after 14m8s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, ubuntu-latest) (push) Failing after 14m8s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, ubuntu-latest) (push) Failing after 14m10s
Validate 'setup-go' / go-version-file-with-gowork (ubuntu-latest) (push) Failing after 14m11s
Validate 'setup-go' / go-version-file (ubuntu-latest) (push) Failing after 14m12s
Validate 'setup-go' / check-latest (1.21, ubuntu-latest) (push) Failing after 14m14s
Validate 'setup-go' / check-latest (1.20, ubuntu-latest) (push) Failing after 14m16s
Validate 'setup-go' / Setup local-cache version (1.23.2, ubuntu-latest) (push) Failing after 14m18s
Validate 'setup-go' / Setup local-cache version (1.21.13, ubuntu-latest) (push) Failing after 14m21s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, oldstable) (push) Failing after 14m23s
Validate 'setup-go' / stable (ubuntu-latest) (push) Failing after 14m27s
Validate 'setup-go' / stable (macos-13) (push) Has been cancelled
Validate 'setup-go' / stable (macos-latest) (push) Has been cancelled
Validate 'setup-go' / stable (windows-latest) (push) Has been cancelled
Validate 'setup-go' / oldstable (macos-13) (push) Has been cancelled
Validate 'setup-go' / oldstable (macos-latest) (push) Has been cancelled
Validate 'setup-go' / oldstable (windows-latest) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x32, windows-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x32, windows-latest, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-13, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-13, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, macos-latest, stable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, windows-latest, oldstable) (push) Has been cancelled
Validate 'setup-go' / aliases-arch (x64, windows-latest, stable) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.21.13, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.20, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / check-latest (1.23, windows-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file (macos-13) (push) Has been cancelled
Validate 'setup-go' / go-version-file (macos-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file (windows-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (macos-13) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (macos-latest) (push) Has been cancelled
Validate 'setup-go' / go-version-file-with-gowork (windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-13) (push) Has been cancelled
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, macos-13) (push) Has been cancelled
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Has been cancelled
Validate Windows installation / Find default go version (push) Has been cancelled
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Has been cancelled
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Has been cancelled
This commit is contained in:
parent
78535dd5f2
commit
29694d72cd
25
dist/setup/index.js
vendored
25
dist/setup/index.js
vendored
@ -93475,10 +93475,33 @@ function extractGoArchive(archivePath) {
|
||||
});
|
||||
}
|
||||
exports.extractGoArchive = extractGoArchive;
|
||||
function isIToolRelease(obj) {
|
||||
return (typeof obj === 'object' &&
|
||||
obj !== null &&
|
||||
typeof obj.version === 'string' &&
|
||||
typeof obj.stable === 'boolean' &&
|
||||
Array.isArray(obj.files) &&
|
||||
obj.files.every((file) => typeof file.filename === 'string' &&
|
||||
typeof file.platform === 'string' &&
|
||||
typeof file.arch === 'string' &&
|
||||
typeof file.download_url === 'string'));
|
||||
}
|
||||
function getManifest(auth) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
return yield getManifestFromRepo(auth);
|
||||
const manifest = yield getManifestFromRepo(auth);
|
||||
if (Array.isArray(manifest) &&
|
||||
manifest.length &&
|
||||
manifest.every(isIToolRelease)) {
|
||||
return manifest;
|
||||
}
|
||||
let errorMessage = 'An unexpected error occurred while fetching the manifest.';
|
||||
if (typeof manifest === 'object' &&
|
||||
manifest !== null &&
|
||||
'message' in manifest) {
|
||||
errorMessage = manifest.message;
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
catch (err) {
|
||||
core.debug('Fetching the manifest via the API failed.');
|
||||
|
@ -275,11 +275,46 @@ export async function extractGoArchive(archivePath: string): Promise<string> {
|
||||
return extPath;
|
||||
}
|
||||
|
||||
function isIToolRelease(obj: any): obj is tc.IToolRelease {
|
||||
return (
|
||||
typeof obj === 'object' &&
|
||||
obj !== null &&
|
||||
typeof obj.version === 'string' &&
|
||||
typeof obj.stable === 'boolean' &&
|
||||
Array.isArray(obj.files) &&
|
||||
obj.files.every(
|
||||
(file: any) =>
|
||||
typeof file.filename === 'string' &&
|
||||
typeof file.platform === 'string' &&
|
||||
typeof file.arch === 'string' &&
|
||||
typeof file.download_url === 'string'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export async function getManifest(
|
||||
auth: string | undefined
|
||||
): Promise<tc.IToolRelease[]> {
|
||||
try {
|
||||
return await getManifestFromRepo(auth);
|
||||
const manifest = await getManifestFromRepo(auth);
|
||||
if (
|
||||
Array.isArray(manifest) &&
|
||||
manifest.length &&
|
||||
manifest.every(isIToolRelease)
|
||||
) {
|
||||
return manifest;
|
||||
}
|
||||
|
||||
let errorMessage =
|
||||
'An unexpected error occurred while fetching the manifest.';
|
||||
if (
|
||||
typeof manifest === 'object' &&
|
||||
manifest !== null &&
|
||||
'message' in manifest
|
||||
) {
|
||||
errorMessage = (manifest as {message: string}).message;
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
} catch (err) {
|
||||
core.debug('Fetching the manifest via the API failed.');
|
||||
if (err instanceof Error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user