Skip to content

Commit

Permalink
Remove fallback logic for GHES 2.22
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Nov 23, 2022
1 parent 39fe7aa commit d8597f3
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 110 deletions.
17 changes: 1 addition & 16 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

22 changes: 2 additions & 20 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions lib/codeql.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.test.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/testing-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/testing-utils.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions src/actions-util.ts
Expand Up @@ -864,23 +864,6 @@ function isDependabotActor() {
return process.env["GITHUB_ACTOR"] === "dependabot[bot]";
}

// Is the current action executing a local copy (i.e. we're running a workflow on the codeql-action repo itself)
// as opposed to running a remote action (i.e. when another repo references us)
export function isRunningLocalAction(): boolean {
const relativeScriptPath = getRelativeScriptPath();
return (
relativeScriptPath.startsWith("..") || path.isAbsolute(relativeScriptPath)
);
}

// Get the location where the action is running from.
// This can be used to get the actions name or tell if we're running a local action.
export function getRelativeScriptPath(): string {
const runnerTemp = getRequiredEnvParam("RUNNER_TEMP");
const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
return path.relative(actionsDirectory, __filename);
}

// Reads the contents of GITHUB_EVENT_PATH as a JSON object
function getWorkflowEvent(): any {
const eventJsonFile = getRequiredEnvParam("GITHUB_EVENT_PATH");
Expand Down
16 changes: 0 additions & 16 deletions src/codeql.test.ts
Expand Up @@ -421,22 +421,6 @@ test("getExtraOptions throws for bad content", (t) => {
);
});

test("getCodeQLActionRepository", (t) => {
const logger = getRunnerLogger(true);

initializeEnvironment("1.2.3");

// isRunningLocalAction() === true
delete process.env["GITHUB_ACTION_REPOSITORY"];
process.env["RUNNER_TEMP"] = path.dirname(__dirname);
const repoLocalRunner = codeql.getCodeQLActionRepository(logger);
t.deepEqual(repoLocalRunner, "github/codeql-action");

process.env["GITHUB_ACTION_REPOSITORY"] = "xxx/yyy";
const repoEnv = codeql.getCodeQLActionRepository(logger);
t.deepEqual(repoEnv, "xxx/yyy");
});

test("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0", async (t) => {
const runnerConstructorStub = stubToolRunnerConstructor();
const codeqlObject = await codeql.getCodeQLForTesting();
Expand Down

0 comments on commit d8597f3

Please sign in to comment.