Skip to content

Commit b9f36ce

Browse files
committed
upgrade @actions/core
1 parent 5dea36e commit b9f36ce

File tree

3 files changed

+96
-81
lines changed

3 files changed

+96
-81
lines changed

dist/index.js

Lines changed: 83 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -139,59 +139,6 @@ var require_command = __commonJS({
139139
}
140140
});
141141

142-
// node_modules/@actions/core/lib/file-command.js
143-
var require_file_command = __commonJS({
144-
"node_modules/@actions/core/lib/file-command.js"(exports2) {
145-
"use strict";
146-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
147-
if (k2 === void 0)
148-
k2 = k;
149-
Object.defineProperty(o, k2, { enumerable: true, get: function() {
150-
return m[k];
151-
} });
152-
} : function(o, m, k, k2) {
153-
if (k2 === void 0)
154-
k2 = k;
155-
o[k2] = m[k];
156-
});
157-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
158-
Object.defineProperty(o, "default", { enumerable: true, value: v });
159-
} : function(o, v) {
160-
o["default"] = v;
161-
});
162-
var __importStar = exports2 && exports2.__importStar || function(mod) {
163-
if (mod && mod.__esModule)
164-
return mod;
165-
var result = {};
166-
if (mod != null) {
167-
for (var k in mod)
168-
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
169-
__createBinding(result, mod, k);
170-
}
171-
__setModuleDefault(result, mod);
172-
return result;
173-
};
174-
Object.defineProperty(exports2, "__esModule", { value: true });
175-
exports2.issueCommand = void 0;
176-
var fs2 = __importStar(require("fs"));
177-
var os = __importStar(require("os"));
178-
var utils_1 = require_utils();
179-
function issueCommand(command, message) {
180-
const filePath = process.env[`GITHUB_${command}`];
181-
if (!filePath) {
182-
throw new Error(`Unable to find environment variable for file command ${command}`);
183-
}
184-
if (!fs2.existsSync(filePath)) {
185-
throw new Error(`Missing file at path: ${filePath}`);
186-
}
187-
fs2.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
188-
encoding: "utf8"
189-
});
190-
}
191-
exports2.issueCommand = issueCommand;
192-
}
193-
});
194-
195142
// node_modules/uuid/dist/rng.js
196143
var require_rng = __commonJS({
197144
"node_modules/uuid/dist/rng.js"(exports2) {
@@ -683,6 +630,72 @@ var require_dist = __commonJS({
683630
}
684631
});
685632

633+
// node_modules/@actions/core/lib/file-command.js
634+
var require_file_command = __commonJS({
635+
"node_modules/@actions/core/lib/file-command.js"(exports2) {
636+
"use strict";
637+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
638+
if (k2 === void 0)
639+
k2 = k;
640+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
641+
return m[k];
642+
} });
643+
} : function(o, m, k, k2) {
644+
if (k2 === void 0)
645+
k2 = k;
646+
o[k2] = m[k];
647+
});
648+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
649+
Object.defineProperty(o, "default", { enumerable: true, value: v });
650+
} : function(o, v) {
651+
o["default"] = v;
652+
});
653+
var __importStar = exports2 && exports2.__importStar || function(mod) {
654+
if (mod && mod.__esModule)
655+
return mod;
656+
var result = {};
657+
if (mod != null) {
658+
for (var k in mod)
659+
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
660+
__createBinding(result, mod, k);
661+
}
662+
__setModuleDefault(result, mod);
663+
return result;
664+
};
665+
Object.defineProperty(exports2, "__esModule", { value: true });
666+
exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0;
667+
var fs2 = __importStar(require("fs"));
668+
var os = __importStar(require("os"));
669+
var uuid_1 = require_dist();
670+
var utils_1 = require_utils();
671+
function issueFileCommand(command, message) {
672+
const filePath = process.env[`GITHUB_${command}`];
673+
if (!filePath) {
674+
throw new Error(`Unable to find environment variable for file command ${command}`);
675+
}
676+
if (!fs2.existsSync(filePath)) {
677+
throw new Error(`Missing file at path: ${filePath}`);
678+
}
679+
fs2.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
680+
encoding: "utf8"
681+
});
682+
}
683+
exports2.issueFileCommand = issueFileCommand;
684+
function prepareKeyValueMessage(key, value) {
685+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
686+
const convertedValue = utils_1.toCommandValue(value);
687+
if (key.includes(delimiter)) {
688+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
689+
}
690+
if (convertedValue.includes(delimiter)) {
691+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
692+
}
693+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
694+
}
695+
exports2.prepareKeyValueMessage = prepareKeyValueMessage;
696+
}
697+
});
698+
686699
// node_modules/@actions/http-client/lib/proxy.js
687700
var require_proxy = __commonJS({
688701
"node_modules/@actions/http-client/lib/proxy.js"(exports2) {
@@ -1997,7 +2010,6 @@ var require_core = __commonJS({
19972010
var utils_1 = require_utils();
19982011
var os = __importStar(require("os"));
19992012
var path = __importStar(require("path"));
2000-
var uuid_1 = require_dist();
20012013
var oidc_utils_1 = require_oidc_utils();
20022014
var ExitCode;
20032015
(function(ExitCode2) {
@@ -2009,18 +2021,9 @@ var require_core = __commonJS({
20092021
process.env[name] = convertedVal;
20102022
const filePath = process.env["GITHUB_ENV"] || "";
20112023
if (filePath) {
2012-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
2013-
if (name.includes(delimiter)) {
2014-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
2015-
}
2016-
if (convertedVal.includes(delimiter)) {
2017-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
2018-
}
2019-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
2020-
file_command_1.issueCommand("ENV", commandValue);
2021-
} else {
2022-
command_1.issueCommand("set-env", { name }, convertedVal);
2024+
return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name, val));
20232025
}
2026+
command_1.issueCommand("set-env", { name }, convertedVal);
20242027
}
20252028
exports2.exportVariable = exportVariable;
20262029
function setSecret(secret) {
@@ -2030,7 +2033,7 @@ var require_core = __commonJS({
20302033
function addPath(inputPath) {
20312034
const filePath = process.env["GITHUB_PATH"] || "";
20322035
if (filePath) {
2033-
file_command_1.issueCommand("PATH", inputPath);
2036+
file_command_1.issueFileCommand("PATH", inputPath);
20342037
} else {
20352038
command_1.issueCommand("add-path", {}, inputPath);
20362039
}
@@ -2050,7 +2053,10 @@ var require_core = __commonJS({
20502053
exports2.getInput = getInput2;
20512054
function getMultilineInput(name, options) {
20522055
const inputs = getInput2(name, options).split("\n").filter((x) => x !== "");
2053-
return inputs;
2056+
if (options && options.trimWhitespace === false) {
2057+
return inputs;
2058+
}
2059+
return inputs.map((input) => input.trim());
20542060
}
20552061
exports2.getMultilineInput = getMultilineInput;
20562062
function getBooleanInput(name, options) {
@@ -2066,8 +2072,12 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
20662072
}
20672073
exports2.getBooleanInput = getBooleanInput;
20682074
function setOutput2(name, value) {
2075+
const filePath = process.env["GITHUB_OUTPUT"] || "";
2076+
if (filePath) {
2077+
return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value));
2078+
}
20692079
process.stdout.write(os.EOL);
2070-
command_1.issueCommand("set-output", { name }, value);
2080+
command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value));
20712081
}
20722082
exports2.setOutput = setOutput2;
20732083
function setCommandEcho(enabled) {
@@ -2125,7 +2135,11 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
21252135
}
21262136
exports2.group = group;
21272137
function saveState(name, value) {
2128-
command_1.issueCommand("save-state", { name }, value);
2138+
const filePath = process.env["GITHUB_STATE"] || "";
2139+
if (filePath) {
2140+
return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name, value));
2141+
}
2142+
command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value));
21292143
}
21302144
exports2.saveState = saveState;
21312145
function getState(name) {

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "github-action-json-file-properties",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"author": "zoexx",
55
"description": "GitHub Action to load properties from a JSON file.",
66
"main": "dist/index.js",
77
"scripts": {
8-
"build": "esbuild src/index.ts --bundle --platform=node --target=node16 --outfile=dist/index.js"
8+
"build": "esbuild src/index.ts --bundle --platform=node --target=node16 --outfile=dist/index.js",
9+
"text": "act"
910
},
1011
"repository": {
1112
"type": "git",
@@ -18,7 +19,7 @@
1819
],
1920
"license": "MIT",
2021
"dependencies": {
21-
"@actions/core": "^1.9.1"
22+
"@actions/core": "^1.10.0"
2223
},
2324
"devDependencies": {
2425
"@types/node": "^16.4.5",

0 commit comments

Comments
 (0)