Skip to content

Commit

Permalink
Tolerate forks of github/codeql-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Soref committed May 25, 2023
1 parent dba4f66 commit a5879b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/workflow.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/workflow.js.map

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

8 changes: 6 additions & 2 deletions src/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as yaml from "js-yaml";

import * as api from "./api-client";
import { Logger } from "./logging";
import { getRequiredEnvParam } from "./util";
import { getRequiredEnvParam, isInTestMode } from "./util";

export interface WorkflowJobStep {
name?: string;
Expand Down Expand Up @@ -389,7 +389,11 @@ function getInputOrThrow(
* This allows us to test workflow parsing functionality as a CodeQL Action PR check.
*/
function getAnalyzeActionName() {
if (getRequiredEnvParam("GITHUB_REPOSITORY") === "github/codeql-action") {
if (
isInTestMode() ||
process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] ===
"codeql-action-pr-checks"
) {
return "./analyze";
} else {
return "github/codeql-action/analyze";
Expand Down

0 comments on commit a5879b7

Please sign in to comment.