Make unguarded-action-lib better at ignoring uses of toolcache

This commit is contained in:
Robert
2021-03-16 13:14:17 +00:00
parent daff33213e
commit d698cb3d2b
16 changed files with 103 additions and 50 deletions

View File

@@ -277,17 +277,10 @@ export async function setupCodeQL(
codeqlURL: string | undefined,
apiDetails: api.GitHubApiDetails,
tempDir: string,
toolsDir: string,
mode: util.Mode,
variant: util.GitHubVariant,
logger: Logger
): Promise<{ codeql: CodeQL; toolsVersion: string }> {
// Setting these two env vars makes the toolcache code safe to use outside,
// of actions but this is obviously not a great thing we're doing and it would
// be better to write our own implementation to use outside of actions.
process.env["RUNNER_TEMP"] = tempDir;
process.env["RUNNER_TOOL_CACHE"] = toolsDir;
try {
// We use the special value of 'latest' to prioritize the version in the
// defaults over any pinned cached version.