aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/@actions/core/lib/core.js
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-02-28 21:59:12 +0100
committerEgor Tensin <egor@tensin.name>2026-02-28 22:19:57 +0100
commit9611c248995ad3bacda1d0a93d0b5e1e6605d162 (patch)
treeeb3ae35b426e9d72e7cb34e8e9cc0453745a8e17 /node_modules/@actions/core/lib/core.js
parentDEVELOPMENT.md: expand on sources (diff)
downloadcleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.tar.gz
cleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.zip
upgrade actions/core to version 2
Diffstat (limited to 'node_modules/@actions/core/lib/core.js')
-rw-r--r--node_modules/@actions/core/lib/core.js95
1 files changed, 65 insertions, 30 deletions
diff --git a/node_modules/@actions/core/lib/core.js b/node_modules/@actions/core/lib/core.js
index 8f85466..6ad8ee2 100644
--- a/node_modules/@actions/core/lib/core.js
+++ b/node_modules/@actions/core/lib/core.js
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
-var __importStar = (this && this.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
+var __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
-exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
+exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.ExitCode = void 0;
+exports.exportVariable = exportVariable;
+exports.setSecret = setSecret;
+exports.addPath = addPath;
+exports.getInput = getInput;
+exports.getMultilineInput = getMultilineInput;
+exports.getBooleanInput = getBooleanInput;
+exports.setOutput = setOutput;
+exports.setCommandEcho = setCommandEcho;
+exports.setFailed = setFailed;
+exports.isDebug = isDebug;
+exports.debug = debug;
+exports.error = error;
+exports.warning = warning;
+exports.notice = notice;
+exports.info = info;
+exports.startGroup = startGroup;
+exports.endGroup = endGroup;
+exports.group = group;
+exports.saveState = saveState;
+exports.getState = getState;
+exports.getIDToken = getIDToken;
const command_1 = require("./command");
const file_command_1 = require("./file-command");
const utils_1 = require("./utils");
@@ -71,15 +102,38 @@ function exportVariable(name, val) {
}
(0, command_1.issueCommand)('set-env', { name }, convertedVal);
}
-exports.exportVariable = exportVariable;
/**
* Registers a secret which will get masked from logs
- * @param secret value of the secret
+ *
+ * @param secret - Value of the secret to be masked
+ * @remarks
+ * This function instructs the Actions runner to mask the specified value in any
+ * logs produced during the workflow run. Once registered, the secret value will
+ * be replaced with asterisks (***) whenever it appears in console output, logs,
+ * or error messages.
+ *
+ * This is useful for protecting sensitive information such as:
+ * - API keys
+ * - Access tokens
+ * - Authentication credentials
+ * - URL parameters containing signatures (SAS tokens)
+ *
+ * Note that masking only affects future logs; any previous appearances of the
+ * secret in logs before calling this function will remain unmasked.
+ *
+ * @example
+ * ```typescript
+ * // Register an API token as a secret
+ * const apiToken = "abc123xyz456";
+ * setSecret(apiToken);
+ *
+ * // Now any logs containing this value will show *** instead
+ * console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
+ * ```
*/
function setSecret(secret) {
(0, command_1.issueCommand)('add-mask', {}, secret);
}
-exports.setSecret = setSecret;
/**
* Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath
@@ -94,7 +148,6 @@ function addPath(inputPath) {
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
-exports.addPath = addPath;
/**
* Gets the value of an input.
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
@@ -114,7 +167,6 @@ function getInput(name, options) {
}
return val.trim();
}
-exports.getInput = getInput;
/**
* Gets the values of an multiline input. Each value is also trimmed.
*
@@ -132,7 +184,6 @@ function getMultilineInput(name, options) {
}
return inputs.map(input => input.trim());
}
-exports.getMultilineInput = getMultilineInput;
/**
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
@@ -154,7 +205,6 @@ function getBooleanInput(name, options) {
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
}
-exports.getBooleanInput = getBooleanInput;
/**
* Sets the value of an output.
*
@@ -170,7 +220,6 @@ function setOutput(name, value) {
process.stdout.write(os.EOL);
(0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));
}
-exports.setOutput = setOutput;
/**
* Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
@@ -179,7 +228,6 @@ exports.setOutput = setOutput;
function setCommandEcho(enabled) {
(0, command_1.issue)('echo', enabled ? 'on' : 'off');
}
-exports.setCommandEcho = setCommandEcho;
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
@@ -192,7 +240,6 @@ function setFailed(message) {
process.exitCode = ExitCode.Failure;
error(message);
}
-exports.setFailed = setFailed;
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
@@ -202,7 +249,6 @@ exports.setFailed = setFailed;
function isDebug() {
return process.env['RUNNER_DEBUG'] === '1';
}
-exports.isDebug = isDebug;
/**
* Writes debug message to user log
* @param message debug message
@@ -210,7 +256,6 @@ exports.isDebug = isDebug;
function debug(message) {
(0, command_1.issueCommand)('debug', {}, message);
}
-exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message. Errors will be converted to string via toString()
@@ -219,7 +264,6 @@ exports.debug = debug;
function error(message, properties = {}) {
(0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
-exports.error = error;
/**
* Adds a warning issue
* @param message warning issue message. Errors will be converted to string via toString()
@@ -228,7 +272,6 @@ exports.error = error;
function warning(message, properties = {}) {
(0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
-exports.warning = warning;
/**
* Adds a notice issue
* @param message notice issue message. Errors will be converted to string via toString()
@@ -237,7 +280,6 @@ exports.warning = warning;
function notice(message, properties = {}) {
(0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
-exports.notice = notice;
/**
* Writes info to log with console.log.
* @param message info message
@@ -245,7 +287,6 @@ exports.notice = notice;
function info(message) {
process.stdout.write(message + os.EOL);
}
-exports.info = info;
/**
* Begin an output group.
*
@@ -256,14 +297,12 @@ exports.info = info;
function startGroup(name) {
(0, command_1.issue)('group', name);
}
-exports.startGroup = startGroup;
/**
* End an output group.
*/
function endGroup() {
(0, command_1.issue)('endgroup');
}
-exports.endGroup = endGroup;
/**
* Wrap an asynchronous function call in a group.
*
@@ -285,7 +324,6 @@ function group(name, fn) {
return result;
});
}
-exports.group = group;
//-----------------------------------------------------------------------
// Wrapper action state
//-----------------------------------------------------------------------
@@ -303,7 +341,6 @@ function saveState(name, value) {
}
(0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));
}
-exports.saveState = saveState;
/**
* Gets the value of an state set by this action's main execution.
*
@@ -313,13 +350,11 @@ exports.saveState = saveState;
function getState(name) {
return process.env[`STATE_${name}`] || '';
}
-exports.getState = getState;
function getIDToken(aud) {
return __awaiter(this, void 0, void 0, function* () {
return yield oidc_utils_1.OidcClient.getIDToken(aud);
});
}
-exports.getIDToken = getIDToken;
/**
* Summary exports
*/