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

7
lib/codeql.js generated
View file

@ -151,12 +151,7 @@ async function toolcacheDownloadTool(url, headers, tempDir, logger) {
await pipeline(response.message, fs.createWriteStream(dest));
return dest;
}
async function setupCodeQL(codeqlURL, apiDetails, tempDir, toolsDir, mode, variant, logger) {
// 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;
async function setupCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger) {
try {
// We use the special value of 'latest' to prioritize the version in the
// defaults over any pinned cached version.