From da830ea0e9dae2e0018f46782e46ab333775f0cf Mon Sep 17 00:00:00 2001 From: mahabaleshwars <147705296+mahabaleshwars@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:56:55 +0530 Subject: [PATCH] testing with different input --- dist/setup/index.js | 14 +++++++++++--- src/install-python.ts | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d3ff39f9..bf91b555 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -91648,11 +91648,19 @@ exports.findReleaseFromManifest = findReleaseFromManifest; function getManifest() { return __awaiter(this, void 0, void 0, function* () { try { - // const manifestFromRepo = await getManifestFromRepo(); - const manifestFromRepo = null; + //const manifestFromRepo = await getManifestFromRepo(); + const manifestFromRepo = { + sha: '5418fd77743bd877e972056787b3ee67a5725566', + node_id: 'MDQ6QmxvYjI1MDA3NzkzMzo1NDE4ZmQ3Nzc0M2JkODc3ZTk3MjA1Njc4N2IzZWU2N2E1NzI1NTY2', + size: 296984, + url: 'https://api.github.com/repos/actions/python-versions/git/blobs/5418fd77743bd877e972056787b3ee67a5725566', + content: 'fasfWfasdkjnflaknc@fakjsdhfjlakjlkfj', + encoding: 'base64' + }; core.info('Successfully fetched the manifest from the repo.'); core.info(`Manifest from repo: ${JSON.stringify(manifestFromRepo)}`); - if (!Array.isArray(manifestFromRepo)) { + if (!Array.isArray(manifestFromRepo) || + !manifestFromRepo.every(isValidManifestEntry)) { throw new Error('Invalid response'); } return manifestFromRepo; diff --git a/src/install-python.ts b/src/install-python.ts index 95d66cd7..43d7c664 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -35,11 +35,22 @@ export async function findReleaseFromManifest( export async function getManifest(): Promise { try { - // const manifestFromRepo = await getManifestFromRepo(); - const manifestFromRepo = null; + //const manifestFromRepo = await getManifestFromRepo(); + const manifestFromRepo = { + sha: '5418fd77743bd877e972056787b3ee67a5725566', + node_id: + 'MDQ6QmxvYjI1MDA3NzkzMzo1NDE4ZmQ3Nzc0M2JkODc3ZTk3MjA1Njc4N2IzZWU2N2E1NzI1NTY2', + size: 296984, + url: 'https://api.github.com/repos/actions/python-versions/git/blobs/5418fd77743bd877e972056787b3ee67a5725566', + content: 'fasfWfasdkjnflaknc@fakjsdhfjlakjlkfj', + encoding: 'base64' + }; core.info('Successfully fetched the manifest from the repo.'); core.info(`Manifest from repo: ${JSON.stringify(manifestFromRepo)}`); - if (!Array.isArray(manifestFromRepo)) { + if ( + !Array.isArray(manifestFromRepo) || + !manifestFromRepo.every(isValidManifestEntry) + ) { throw new Error('Invalid response'); } return manifestFromRepo;