diff --git a/dist/index.js b/dist/index.js index 5058629..3116cdb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -39,18 +39,11 @@ async function downloadCLI (url) { const pathToCLIZip = await tc.downloadTool(url); core.info(`Terraform CLI Download Path is ${pathToCLIZip}`) - try { - const files = await fs.readdir(pathToCLIZip); - for (const file of files) - core.info(file); - - } catch (error) { - core.error(error); - throw error; - } + fixedPathToCLIZip=`${pathToCLIZip}.zip` + io.mv(pathToCLIZip,fixedPathToCLIZip) core.debug('Extracting Terraform CLI zip file'); - const pathToCLI = await tc.extractZip(pathToCLIZip); + const pathToCLI = await tc.extractZip(fixedPathToCLIZip); core.debug(`Terraform CLI path is ${pathToCLI}.`); if (!pathToCLIZip || !pathToCLI) { diff --git a/lib/setup-terraform.js b/lib/setup-terraform.js index aecf9ec..5e5288a 100644 --- a/lib/setup-terraform.js +++ b/lib/setup-terraform.js @@ -33,18 +33,11 @@ async function downloadCLI (url) { const pathToCLIZip = await tc.downloadTool(url); core.info(`Terraform CLI Download Path is ${pathToCLIZip}`) - try { - const files = await fs.readdir(pathToCLIZip); - for (const file of files) - core.info(file); - - } catch (error) { - core.error(error); - throw error; - } + fixedPathToCLIZip=`${pathToCLIZip}.zip` + io.mv(pathToCLIZip,fixedPathToCLIZip) core.debug('Extracting Terraform CLI zip file'); - const pathToCLI = await tc.extractZip(pathToCLIZip); + const pathToCLI = await tc.extractZip(fixedPathToCLIZip); core.debug(`Terraform CLI path is ${pathToCLI}.`); if (!pathToCLIZip || !pathToCLI) {