aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/@actions/core/lib/file-command.js
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-02-28 22:23:19 +0100
committerEgor Tensin <egor@tensin.name>2026-02-28 22:28:23 +0100
commitcf0901d753db0bf4d15baf625a6fa537978b03a9 (patch)
tree41ae5e7f9eacdc67b9fa980596c803b9c50ca188 /node_modules/@actions/core/lib/file-command.js
parentupgrade actions/core to version 2 (diff)
downloadcleanup-path-cf0901d753db0bf4d15baf625a6fa537978b03a9.tar.gz
cleanup-path-cf0901d753db0bf4d15baf625a6fa537978b03a9.zip
upgrade actions/core to version 3v4.0.3v4
The relevant changes are in clean.js/restore.js. I'm very, very far away from the entire Javascript infrastructure, and absolutely don't understand why this changes were necessary. Thanks, ChatGPT! Supposedly, this has something to do with the actions/core's transition to ESM or whatever.
Diffstat (limited to 'node_modules/@actions/core/lib/file-command.js')
-rw-r--r--node_modules/@actions/core/lib/file-command.js53
1 files changed, 8 insertions, 45 deletions
diff --git a/node_modules/@actions/core/lib/file-command.js b/node_modules/@actions/core/lib/file-command.js
index 807447a..c1d9bf4 100644
--- a/node_modules/@actions/core/lib/file-command.js
+++ b/node_modules/@actions/core/lib/file-command.js
@@ -1,48 +1,11 @@
-"use strict";
// For internal use, subject to change.
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
-}) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
-}));
-var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
-}) : function(o, v) {
- o["default"] = v;
-});
-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;
- };
-})();
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.issueFileCommand = issueFileCommand;
-exports.prepareKeyValueMessage = prepareKeyValueMessage;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
-const crypto = __importStar(require("crypto"));
-const fs = __importStar(require("fs"));
-const os = __importStar(require("os"));
-const utils_1 = require("./utils");
-function issueFileCommand(command, message) {
+import * as crypto from 'crypto';
+import * as fs from 'fs';
+import * as os from 'os';
+import { toCommandValue } from './utils.js';
+export function issueFileCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -50,13 +13,13 @@ function issueFileCommand(command, message) {
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
- fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, {
+ fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
-function prepareKeyValueMessage(key, value) {
+export function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${crypto.randomUUID()}`;
- const convertedValue = (0, utils_1.toCommandValue)(value);
+ const convertedValue = toCommandValue(value);
// These should realistically never happen, but just in case someone finds a
// way to exploit uuid generation let's not allow keys or values that contain
// the delimiter.