Skip to content

Commit d8c1c66

Browse files
committed
Move isDefaultSetup to actions-util.ts and change implementation
1 parent 9ec401a commit d8c1c66

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
@@ -472,6 +472,11 @@ export function isSelfHostedRunner() {
472472
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
473473
}
474474

475+
/** Determines whether we are running in default setup. */
476+
export function isDefaultSetup(): boolean {
477+
return getWorkflowEventName() === "dynamic";
478+
}
479+
475480
export function prettyPrintInvocation(cmd: string, args: string[]): string {
476481
return [cmd, ...args].map((x) => (x.includes(" ") ? `'${x}'` : x)).join(" ");
477482
}

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";
@@ -710,13 +711,6 @@ async function recordZstdAvailability(
710711
);
711712
}
712713

713-
/** Determines whether we are running in default setup. */
714-
function isDefaultSetup(): boolean {
715-
// This is set to something in default setup runs.
716-
// TODO: replace with something better, if there's something.
717-
return process.env["CODE_SCANNING_WORKFLOW_FILE"] !== undefined;
718-
}
719-
720714
/** Determines whether dependency caching is enabled. */
721715
function getDependencyCachingEnabled(): boolean {
722716
// If the workflow specified something always respect that

0 commit comments

Comments
 (0)