Skip to content

Commit 4ec740a

Browse files
committed
Move isDefaultSetup to actions-util.ts and change implementation
1 parent ba9ce7c commit 4ec740a

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

lib/actions-util.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.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.

lib/init-action.js

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

lib/init-action.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/actions-util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,8 @@ export const getFileType = async (filePath: string): Promise<string> => {
480480
export function isSelfHostedRunner() {
481481
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
482482
}
483+
484+
/** Determines whether we are running in default setup. */
485+
export function isDefaultSetup(): boolean {
486+
return getWorkflowEventName() === "dynamic";
487+
}

src/init-action.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
getOptionalInput,
1313
getRequiredInput,
1414
getTemporaryDirectory,
15+
isDefaultSetup,
1516
} from "./actions-util";
1617
import { getGitHubVersion } from "./api-client";
1718
import { CodeQL } from "./codeql";
@@ -602,13 +603,6 @@ function getTrapCachingEnabled(): boolean {
602603
return true;
603604
}
604605

605-
/** Determines whether we are running in default setup. */
606-
function isDefaultSetup(): boolean {
607-
// This is set to something in default setup runs.
608-
// TODO: replace with something better, if there's something.
609-
return process.env["CODE_SCANNING_WORKFLOW_FILE"] !== undefined;
610-
}
611-
612606
/** Determines whether dependency caching is enabled. */
613607
function getDependencyCachingEnabled(): boolean {
614608
// If the workflow specified something always respect that

0 commit comments

Comments
 (0)