Skip to content

Commit a5879b7

Browse files
committed
Tolerate forks of github/codeql-action
1 parent dba4f66 commit a5879b7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lib/workflow.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/workflow.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/workflow.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as yaml from "js-yaml";
77

88
import * as api from "./api-client";
99
import { Logger } from "./logging";
10-
import { getRequiredEnvParam } from "./util";
10+
import { getRequiredEnvParam, isInTestMode } from "./util";
1111

1212
export interface WorkflowJobStep {
1313
name?: string;
@@ -389,7 +389,11 @@ function getInputOrThrow(
389389
* This allows us to test workflow parsing functionality as a CodeQL Action PR check.
390390
*/
391391
function getAnalyzeActionName() {
392-
if (getRequiredEnvParam("GITHUB_REPOSITORY") === "github/codeql-action") {
392+
if (
393+
isInTestMode() ||
394+
process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] ===
395+
"codeql-action-pr-checks"
396+
) {
393397
return "./analyze";
394398
} else {
395399
return "github/codeql-action/analyze";

0 commit comments

Comments
 (0)