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
3 changed files with 5 additions and 1 deletions

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;
}