mirror of
https://github.com/actions/setup-go.git
synced 2026-07-17 10:43:04 +08:00
0778a10ce4
* Migrate to ESM and upgrade dependencies * Remove unused tsconfig.eslint.json * bump version to 7.0.0 in package.json and package-lock.json * Add ESM migration note to README for V7 * Remove unnecessary devDependencies: ts-node, @types/jest * npm audit fix * Update README with ESM migration details Clarified migration details to ESM for action compatibility. * Downgrade @types/node to ^24, clean up tsconfig and README.
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;
|
|
}
|