Restore original getCodeQLActionRepository behaviour
This commit is contained in:
parent
ac402bf222
commit
9200db3ec4
7 changed files with 15 additions and 13 deletions
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
## [UNRELEASED]
|
## [UNRELEASED]
|
||||||
|
|
||||||
No user facing changes.
|
- Fix `RUNNER_TEMP environment variable must be set` when using runner.
|
||||||
|
|
||||||
## 1.0.3 - 23 Jun 2021
|
## 1.0.3 - 23 Jun 2021
|
||||||
|
|
||||||
No user facing changes.
|
No user facing changes.
|
||||||
|
|
|
||||||
2
lib/codeql.js
generated
2
lib/codeql.js
generated
|
|
@ -47,7 +47,7 @@ function getCodeQLBundleName() {
|
||||||
return `codeql-bundle-${platform}.tar.gz`;
|
return `codeql-bundle-${platform}.tar.gz`;
|
||||||
}
|
}
|
||||||
function getCodeQLActionRepository(logger) {
|
function getCodeQLActionRepository(logger) {
|
||||||
if (util.isActions()) {
|
if (!util.isActions()) {
|
||||||
return CODEQL_DEFAULT_ACTION_REPOSITORY;
|
return CODEQL_DEFAULT_ACTION_REPOSITORY;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
7
lib/codeql.test.js
generated
7
lib/codeql.test.js
generated
|
|
@ -192,17 +192,18 @@ ava_1.default("getExtraOptions throws for bad content", (t) => {
|
||||||
});
|
});
|
||||||
ava_1.default("getCodeQLActionRepository", (t) => {
|
ava_1.default("getCodeQLActionRepository", (t) => {
|
||||||
const logger = logging_1.getRunnerLogger(true);
|
const logger = logging_1.getRunnerLogger(true);
|
||||||
|
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
||||||
util_1.initializeEnvironment(util_1.Mode.actions, "1.2.3");
|
util_1.initializeEnvironment(util_1.Mode.actions, "1.2.3");
|
||||||
const repoActions = codeql.getCodeQLActionRepository(logger);
|
const repoActions = codeql.getCodeQLActionRepository(logger);
|
||||||
t.deepEqual(repoActions, "github/codeql-action");
|
t.deepEqual(repoActions, "github/codeql-action");
|
||||||
|
process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
|
||||||
|
const repoEnv = codeql.getCodeQLActionRepository(logger);
|
||||||
|
t.deepEqual(repoEnv, "xxx/yyy");
|
||||||
util_1.initializeEnvironment(util_1.Mode.runner, "1.2.3");
|
util_1.initializeEnvironment(util_1.Mode.runner, "1.2.3");
|
||||||
// isRunningLocalAction() === true
|
// isRunningLocalAction() === true
|
||||||
delete process.env["GITHUB_ACTION_REPOSITORY"];
|
delete process.env["GITHUB_ACTION_REPOSITORY"];
|
||||||
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
||||||
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
|
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
|
||||||
t.deepEqual(repoLocalRunner, "github/codeql-action");
|
t.deepEqual(repoLocalRunner, "github/codeql-action");
|
||||||
process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
|
|
||||||
const repoEnv = codeql.getCodeQLActionRepository(logger);
|
|
||||||
t.deepEqual(repoEnv, "xxx/yyy");
|
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=codeql.test.js.map
|
//# sourceMappingURL=codeql.test.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -374,10 +374,16 @@ test("getExtraOptions throws for bad content", (t) => {
|
||||||
test("getCodeQLActionRepository", (t) => {
|
test("getCodeQLActionRepository", (t) => {
|
||||||
const logger = getRunnerLogger(true);
|
const logger = getRunnerLogger(true);
|
||||||
|
|
||||||
|
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
||||||
|
|
||||||
initializeEnvironment(Mode.actions, "1.2.3");
|
initializeEnvironment(Mode.actions, "1.2.3");
|
||||||
const repoActions = codeql.getCodeQLActionRepository(logger);
|
const repoActions = codeql.getCodeQLActionRepository(logger);
|
||||||
t.deepEqual(repoActions, "github/codeql-action");
|
t.deepEqual(repoActions, "github/codeql-action");
|
||||||
|
|
||||||
|
process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
|
||||||
|
const repoEnv = codeql.getCodeQLActionRepository(logger);
|
||||||
|
t.deepEqual(repoEnv, "xxx/yyy");
|
||||||
|
|
||||||
initializeEnvironment(Mode.runner, "1.2.3");
|
initializeEnvironment(Mode.runner, "1.2.3");
|
||||||
|
|
||||||
// isRunningLocalAction() === true
|
// isRunningLocalAction() === true
|
||||||
|
|
@ -385,8 +391,4 @@ test("getCodeQLActionRepository", (t) => {
|
||||||
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
|
||||||
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
|
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
|
||||||
t.deepEqual(repoLocalRunner, "github/codeql-action");
|
t.deepEqual(repoLocalRunner, "github/codeql-action");
|
||||||
|
|
||||||
process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
|
|
||||||
const repoEnv = codeql.getCodeQLActionRepository(logger);
|
|
||||||
t.deepEqual(repoEnv, "xxx/yyy");
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ function getCodeQLBundleName(): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCodeQLActionRepository(logger: Logger): string {
|
export function getCodeQLActionRepository(logger: Logger): string {
|
||||||
if (util.isActions()) {
|
if (!util.isActions()) {
|
||||||
return CODEQL_DEFAULT_ACTION_REPOSITORY;
|
return CODEQL_DEFAULT_ACTION_REPOSITORY;
|
||||||
} else {
|
} else {
|
||||||
return getActionsCodeQLActionRepository(logger);
|
return getActionsCodeQLActionRepository(logger);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue