From 5993d7b0191e801a11addc1a4981d4cfd561e711 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 14:49:06 -0500 Subject: [PATCH] fix: use core.info instead of startGroup --- src/utils/setup/setupBin.ts | 19 +++++++------------ src/utils/setup/setupPipPack.ts | 10 +++------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/utils/setup/setupBin.ts b/src/utils/setup/setupBin.ts index 0c9be955..b9536a5f 100644 --- a/src/utils/setup/setupBin.ts +++ b/src/utils/setup/setupBin.ts @@ -1,5 +1,5 @@ import { find, downloadTool, cacheDir } from "@actions/tool-cache" -import { addPath, group, startGroup, endGroup, info } from "@actions/core" +import { addPath, info } from "@actions/core" import { join } from "path" import { existsSync } from "fs" import * as hasha from "hasha" @@ -60,23 +60,18 @@ export async function setupBin( // download ane extract the package into the installation directory. if (!existsSync(rootDir)) { - await group(`Download and extract ${name} ${version}`, async () => { - const downloaded = await downloadTool(url) - await extractFunction?.(downloaded, rootDir) - }) + info(`Download and extract ${name} ${version}`) + const downloaded = await downloadTool(url) + await extractFunction?.(downloaded, rootDir) } const installDir = join(rootDir, extractedFolderName) const binDir = join(installDir, binRelativeDir) // Adding the bin dir to the path - try { - /** The directory which the tool is installed to */ - startGroup(`Add ${binDir} to PATH`) - addPath(binDir) - } finally { - endGroup() - } + /** The directory which the tool is installed to */ + info(`Add ${binDir} to PATH`) + addPath(binDir) // check if inside Github Actions. If so, cache the installation if (typeof process.env.RUNNER_TOOL_CACHE === "string") { diff --git a/src/utils/setup/setupPipPack.ts b/src/utils/setup/setupPipPack.ts index e175ef40..9e72fad6 100644 --- a/src/utils/setup/setupPipPack.ts +++ b/src/utils/setup/setupPipPack.ts @@ -1,7 +1,7 @@ /* eslint-disable require-atomic-updates */ import { exec, getExecOutput } from "@actions/exec" import which from "which" -import { addPath, startGroup, endGroup } from "@actions/core" +import { addPath, info } from "@actions/core" import { setupPython } from "../../python/python" import { isBinUptoDate } from "./version" @@ -36,12 +36,8 @@ export async function setupPipPack(name: string, version?: string) { } else { binDir = (await getExecOutput("python -c 'import sys; print(sys.base_exec_prefix)'")).stdout } - try { - startGroup(`${binDir} to PATH`) - addPath(binDir) - } finally { - endGroup() - } + info(`${binDir} to PATH`) + addPath(binDir) } return { binDir }