Move isDefaultSetup to actions-util.ts and change implementation

This commit is contained in:
Michael B. Gale 2024-07-26 13:30:15 +01:00
parent 259cc5a39c
commit 471ed9f4c5
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
6 changed files with 14 additions and 16 deletions

5
lib/actions-util.js generated
View file

@ -37,6 +37,7 @@ exports.getUploadValue = getUploadValue;
exports.getWorkflowRunID = getWorkflowRunID;
exports.getWorkflowRunAttempt = getWorkflowRunAttempt;
exports.isSelfHostedRunner = isSelfHostedRunner;
exports.isDefaultSetup = isDefaultSetup;
exports.prettyPrintInvocation = prettyPrintInvocation;
exports.ensureEndsInPeriod = ensureEndsInPeriod;
exports.runTool = runTool;
@ -425,6 +426,10 @@ exports.getFileType = getFileType;
function isSelfHostedRunner() {
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
}
/** Determines whether we are running in default setup. */
function isDefaultSetup() {
return getWorkflowEventName() === "dynamic";
}
function prettyPrintInvocation(cmd, args) {
return [cmd, ...args].map((x) => (x.includes(" ") ? `'${x}'` : x)).join(" ");
}