Skip to content

Commit 471ed9f

Browse files
committed
Move isDefaultSetup to actions-util.ts and change implementation
1 parent 259cc5a commit 471ed9f

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
@@ -13,6 +13,7 @@ import {
1313
getRequiredInput,
1414
getTemporaryDirectory,
1515
persistInputs,
16+
isDefaultSetup,
1617
} from "./actions-util";
1718
import { getGitHubVersion } from "./api-client";
1819
import { CodeQL } from "./codeql";
@@ -723,13 +724,6 @@ async function recordZstdAvailability(
723724
);
724725
}
725726

726-
/** Determines whether we are running in default setup. */
727-
function isDefaultSetup(): boolean {
728-
// This is set to something in default setup runs.
729-
// TODO: replace with something better, if there's something.
730-
return process.env["CODE_SCANNING_WORKFLOW_FILE"] !== undefined;
731-
}
732-
733727
/** Determines whether dependency caching is enabled. */
734728
function getDependencyCachingEnabled(): boolean {
735729
// If the workflow specified something always respect that

0 commit comments

Comments
 (0)