mirror of
https://github.com/github/codeql-action.git
synced 2026-11-14 08:41:24 +00:00
Set the CODEQL_WRAPPER env var
The CODEQL_WRAPPER environment variable will be set to "action" if running in an actions context and "runner" otherwise. This variable will be used in the cli to determine which context it is in. Also, use a similar mechanism to provide a different user agent when communicating with the github api.
This commit is contained in:
2
lib/codeql.js
generated
2
lib/codeql.js
generated
@@ -216,6 +216,8 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, mode, v
|
||||
else if (process.platform !== "linux" && process.platform !== "darwin") {
|
||||
throw new Error(`Unsupported platform: ${process.platform}`);
|
||||
}
|
||||
// set a environment variable to let CodeQL know where we are running
|
||||
process.env.CODEQL_WRAPPER = util.isAction() ? "action" : "runner";
|
||||
cachedCodeQL = getCodeQLForCmd(codeqlCmd);
|
||||
return { codeql: cachedCodeQL, toolsVersion: codeqlURLVersion };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user