Tolerate forks of github/codeql-action
This commit is contained in:
parent
dba4f66682
commit
a5879b7b6e
3 changed files with 10 additions and 4 deletions
4
lib/workflow.js
generated
4
lib/workflow.js
generated
|
|
@ -298,7 +298,9 @@ function getInputOrThrow(workflow, jobName, actionName, inputName, matrixVars) {
|
|||
* This allows us to test workflow parsing functionality as a CodeQL Action PR check.
|
||||
*/
|
||||
function getAnalyzeActionName() {
|
||||
if ((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY") === "github/codeql-action") {
|
||||
if ((0, util_1.isInTestMode)() ||
|
||||
process.env["CODEQL_ACTION_TESTING_ENVIRONMENT"] ===
|
||||
"codeql-action-pr-checks") {
|
||||
return "./analyze";
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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;
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue