Add a comment explaining an edge-case.

This commit is contained in:
Chris Gavin 2020-07-27 10:51:51 +01:00
parent 5f057318b6
commit f4e72f4a09
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 5 additions and 1 deletions

2
lib/codeql.js generated
View file

@ -47,6 +47,8 @@ function getCodeQLActionRepository() {
const runnerTemp = util.getRequiredEnvParam("RUNNER_TEMP");
const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
const relativeScriptPath = path.relative(actionsDirectory, __filename);
// This handles the case where the Action does not come from an Action repository,
// e.g. our integration tests which use the Action code from the current checkout.
if (relativeScriptPath.startsWith("..") || path.isAbsolute(relativeScriptPath)) {
return CODEQL_DEFAULT_ACTION_REPOSITORY;
}

File diff suppressed because one or more lines are too long

View file

@ -97,6 +97,8 @@ function getCodeQLActionRepository(): string {
const runnerTemp = util.getRequiredEnvParam("RUNNER_TEMP");
const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
const relativeScriptPath = path.relative(actionsDirectory, __filename);
// This handles the case where the Action does not come from an Action repository,
// e.g. our integration tests which use the Action code from the current checkout.
if (relativeScriptPath.startsWith("..") || path.isAbsolute(relativeScriptPath)) {
return CODEQL_DEFAULT_ACTION_REPOSITORY;
}