mirror of https://github.com/actions/setup-go.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
427 B
TypeScript
14 lines
427 B
TypeScript
import * as httpm from '@actions/http-client';
|
|
import type {IGoVersion} from './installer.js';
|
|
|
|
export async function getVersionsDist(
|
|
dlUrl: string
|
|
): Promise<IGoVersion[] | null> {
|
|
// this returns versions descending so latest is first
|
|
const http: httpm.HttpClient = new httpm.HttpClient('setup-go', [], {
|
|
allowRedirects: true,
|
|
maxRedirects: 3
|
|
});
|
|
return (await http.getJson<IGoVersion[]>(dlUrl)).result;
|
|
}
|