fix: use core.info instead of startGroup

This commit is contained in:
Amin Yahyaabadi 2021-09-16 14:49:06 -05:00
parent 5e61cbc438
commit 5993d7b019
2 changed files with 10 additions and 19 deletions

View File

@ -1,5 +1,5 @@
import { find, downloadTool, cacheDir } from "@actions/tool-cache" 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 { join } from "path"
import { existsSync } from "fs" import { existsSync } from "fs"
import * as hasha from "hasha" import * as hasha from "hasha"
@ -60,23 +60,18 @@ export async function setupBin(
// download ane extract the package into the installation directory. // download ane extract the package into the installation directory.
if (!existsSync(rootDir)) { if (!existsSync(rootDir)) {
await group(`Download and extract ${name} ${version}`, async () => { info(`Download and extract ${name} ${version}`)
const downloaded = await downloadTool(url) const downloaded = await downloadTool(url)
await extractFunction?.(downloaded, rootDir) await extractFunction?.(downloaded, rootDir)
})
} }
const installDir = join(rootDir, extractedFolderName) const installDir = join(rootDir, extractedFolderName)
const binDir = join(installDir, binRelativeDir) const binDir = join(installDir, binRelativeDir)
// Adding the bin dir to the path // Adding the bin dir to the path
try { /** The directory which the tool is installed to */
/** The directory which the tool is installed to */ info(`Add ${binDir} to PATH`)
startGroup(`Add ${binDir} to PATH`) addPath(binDir)
addPath(binDir)
} finally {
endGroup()
}
// check if inside Github Actions. If so, cache the installation // check if inside Github Actions. If so, cache the installation
if (typeof process.env.RUNNER_TOOL_CACHE === "string") { if (typeof process.env.RUNNER_TOOL_CACHE === "string") {

View File

@ -1,7 +1,7 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import { exec, getExecOutput } from "@actions/exec" import { exec, getExecOutput } from "@actions/exec"
import which from "which" import which from "which"
import { addPath, startGroup, endGroup } from "@actions/core" import { addPath, info } from "@actions/core"
import { setupPython } from "../../python/python" import { setupPython } from "../../python/python"
import { isBinUptoDate } from "./version" import { isBinUptoDate } from "./version"
@ -36,12 +36,8 @@ export async function setupPipPack(name: string, version?: string) {
} else { } else {
binDir = (await getExecOutput("python -c 'import sys; print(sys.base_exec_prefix)'")).stdout binDir = (await getExecOutput("python -c 'import sys; print(sys.base_exec_prefix)'")).stdout
} }
try { info(`${binDir} to PATH`)
startGroup(`${binDir} to PATH`) addPath(binDir)
addPath(binDir)
} finally {
endGroup()
}
} }
return { binDir } return { binDir }