Fix invalid API call when running locally

The method getAnalysisKey would call getWorkflowPath and raise an API Error.

This change follows the pattern in prepareLocalRunEnvironment to set a dummy value for the required environment variable, therefore shortcutting the API request.
This commit is contained in:
Simon Engledew 2020-11-04 09:37:42 +00:00
parent bc1ee1620f
commit 5c0e2f93f1
No known key found for this signature in database
GPG key ID: 84302E7B02FE8BCE
7 changed files with 61 additions and 2 deletions

3
lib/actions-util.js generated
View file

@ -58,6 +58,9 @@ function prepareLocalRunEnvironment() {
if (!process.env.GITHUB_JOB) {
core.exportVariable("GITHUB_JOB", "UNKNOWN-JOB");
}
if (!process.env.CODEQL_ACTION_ANALYSIS_KEY) {
core.exportVariable("CODEQL_ACTION_ANALYSIS_KEY", `LOCAL-RUN:${process.env.GITHUB_JOB}`);
}
}
exports.prepareLocalRunEnvironment = prepareLocalRunEnvironment;
/**