diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index dcf33ec..f94f9ee 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -93,7 +93,7 @@ describe('setup-go', () => { getAllVersionsSpy = jest.spyOn(im, 'getManifest'); // httm - httpmGetJsonSpy = jest.spyOn(httpm.HttpClient.prototype, 'getJson') + httpmGetJsonSpy = jest.spyOn(httpm.HttpClient.prototype, 'getJson'); // io whichSpy = jest.spyOn(io, 'which'); @@ -162,9 +162,7 @@ describe('setup-go', () => { }); it('should return manifest from raw URL if repo fetch fails', async () => { - getManifestSpy.mockRejectedValue( - new Error('Fetch failed') - ); + getManifestSpy.mockRejectedValue(new Error('Fetch failed')); httpmGetJsonSpy.mockResolvedValue({ result: goTestManifest }); @@ -812,7 +810,9 @@ describe('setup-go', () => { getManifestSpy.mockImplementation(() => { throw new Error('Unable to download manifest'); }); - httpmGetJsonSpy.mockRejectedValue(new Error('Unable to download manifest from raw URL')); + httpmGetJsonSpy.mockRejectedValue( + new Error('Unable to download manifest from raw URL') + ); getAllVersionsSpy.mockImplementationOnce(() => undefined); dlSpy.mockImplementation(async () => '/some/temp/path'); diff --git a/src/installer.ts b/src/installer.ts index c8fc028..cc0f2dc 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -13,7 +13,6 @@ const MANIFEST_REPO_NAME = 'go-versions'; const MANIFEST_REPO_BRANCH = 'main'; const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; - type InstallationType = 'dist' | 'manifest'; export interface IGoVersionFile { @@ -280,7 +279,9 @@ export async function extractGoArchive(archivePath: string): Promise { return extPath; } -export async function getManifest(auth: string | undefined): Promise { +export async function getManifest( + auth: string | undefined +): Promise { try { return await getManifestFromRepo(auth); } catch (err) { @@ -292,7 +293,9 @@ export async function getManifest(auth: string | undefined): Promise { +function getManifestFromRepo( + auth: string | undefined +): Promise { core.debug( `Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` );