Skip to content

Commit ff0a9e8

Browse files
committed
v3.0.1
1 parent 9d620e4 commit ff0a9e8

File tree

3 files changed

+21
-86
lines changed

3 files changed

+21
-86
lines changed

dist/index.js

+19-84
Original file line numberDiff line numberDiff line change
@@ -1428,8 +1428,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
14281428
};
14291429
Object.defineProperty(exports, "__esModule", { value: true });
14301430
const command_1 = __webpack_require__(351);
1431-
const file_command_1 = __webpack_require__(717);
1432-
const utils_1 = __webpack_require__(278);
14331431
const os = __importStar(__webpack_require__(87));
14341432
const path = __importStar(__webpack_require__(622));
14351433
/**
@@ -1456,17 +1454,9 @@ var ExitCode;
14561454
*/
14571455
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14581456
function exportVariable(name, val) {
1459-
const convertedVal = utils_1.toCommandValue(val);
1457+
const convertedVal = command_1.toCommandValue(val);
14601458
process.env[name] = convertedVal;
1461-
const filePath = process.env['GITHUB_ENV'] || '';
1462-
if (filePath) {
1463-
const delimiter = '_GitHubActionsFileCommandDelimeter_';
1464-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1465-
file_command_1.issueCommand('ENV', commandValue);
1466-
}
1467-
else {
1468-
command_1.issueCommand('set-env', { name }, convertedVal);
1469-
}
1459+
command_1.issueCommand('set-env', { name }, convertedVal);
14701460
}
14711461
exports.exportVariable = exportVariable;
14721462
/**
@@ -1482,13 +1472,7 @@ exports.setSecret = setSecret;
14821472
* @param inputPath
14831473
*/
14841474
function addPath(inputPath) {
1485-
const filePath = process.env['GITHUB_PATH'] || '';
1486-
if (filePath) {
1487-
file_command_1.issueCommand('PATH', inputPath);
1488-
}
1489-
else {
1490-
command_1.issueCommand('add-path', {}, inputPath);
1491-
}
1475+
command_1.issueCommand('add-path', {}, inputPath);
14921476
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
14931477
}
14941478
exports.addPath = addPath;
@@ -2270,32 +2254,6 @@ exports.request = request;
22702254
//# sourceMappingURL=index.js.map
22712255

22722256

2273-
/***/ }),
2274-
2275-
/***/ 278:
2276-
/***/ (function(__unusedmodule, exports) {
2277-
2278-
"use strict";
2279-
2280-
// We use any as a valid input type
2281-
/* eslint-disable @typescript-eslint/no-explicit-any */
2282-
Object.defineProperty(exports, "__esModule", { value: true });
2283-
/**
2284-
* Sanitizes an input into a string so it can be passed into issueCommand safely
2285-
* @param input input to sanitize into a string
2286-
*/
2287-
function toCommandValue(input) {
2288-
if (input === null || input === undefined) {
2289-
return '';
2290-
}
2291-
else if (typeof input === 'string' || input instanceof String) {
2292-
return input;
2293-
}
2294-
return JSON.stringify(input);
2295-
}
2296-
exports.toCommandValue = toCommandValue;
2297-
//# sourceMappingURL=utils.js.map
2298-
22992257
/***/ }),
23002258

23012259
/***/ 294:
@@ -2377,7 +2335,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23772335
};
23782336
Object.defineProperty(exports, "__esModule", { value: true });
23792337
const os = __importStar(__webpack_require__(87));
2380-
const utils_1 = __webpack_require__(278);
23812338
/**
23822339
* Commands
23832340
*
@@ -2431,14 +2388,28 @@ class Command {
24312388
return cmdStr;
24322389
}
24332390
}
2391+
/**
2392+
* Sanitizes an input into a string so it can be passed into issueCommand safely
2393+
* @param input input to sanitize into a string
2394+
*/
2395+
function toCommandValue(input) {
2396+
if (input === null || input === undefined) {
2397+
return '';
2398+
}
2399+
else if (typeof input === 'string' || input instanceof String) {
2400+
return input;
2401+
}
2402+
return JSON.stringify(input);
2403+
}
2404+
exports.toCommandValue = toCommandValue;
24342405
function escapeData(s) {
2435-
return utils_1.toCommandValue(s)
2406+
return toCommandValue(s)
24362407
.replace(/%/g, '%25')
24372408
.replace(/\r/g, '%0D')
24382409
.replace(/\n/g, '%0A');
24392410
}
24402411
function escapeProperty(s) {
2441-
return utils_1.toCommandValue(s)
2412+
return toCommandValue(s)
24422413
.replace(/%/g, '%25')
24432414
.replace(/\r/g, '%0D')
24442415
.replace(/\n/g, '%0A')
@@ -5283,42 +5254,6 @@ module.exports.Singular = Hook.Singular
52835254
module.exports.Collection = Hook.Collection
52845255

52855256

5286-
/***/ }),
5287-
5288-
/***/ 717:
5289-
/***/ (function(__unusedmodule, exports, __webpack_require__) {
5290-
5291-
"use strict";
5292-
5293-
// For internal use, subject to change.
5294-
var __importStar = (this && this.__importStar) || function (mod) {
5295-
if (mod && mod.__esModule) return mod;
5296-
var result = {};
5297-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
5298-
result["default"] = mod;
5299-
return result;
5300-
};
5301-
Object.defineProperty(exports, "__esModule", { value: true });
5302-
// We use any as a valid input type
5303-
/* eslint-disable @typescript-eslint/no-explicit-any */
5304-
const fs = __importStar(__webpack_require__(747));
5305-
const os = __importStar(__webpack_require__(87));
5306-
const utils_1 = __webpack_require__(278);
5307-
function issueCommand(command, message) {
5308-
const filePath = process.env[`GITHUB_${command}`];
5309-
if (!filePath) {
5310-
throw new Error(`Unable to find environment variable for file command ${command}`);
5311-
}
5312-
if (!fs.existsSync(filePath)) {
5313-
throw new Error(`Missing file at path: ${filePath}`);
5314-
}
5315-
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
5316-
encoding: 'utf8'
5317-
});
5318-
}
5319-
exports.issueCommand = issueCommand;
5320-
//# sourceMappingURL=file-command.js.map
5321-
53225257
/***/ }),
53235258

53245259
/***/ 720:

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "github-script",
33
"description": "A GitHub action for executing a simple script",
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"author": "GitHub",
66
"license": "MIT",
77
"main": "dist/index.js",

0 commit comments

Comments
 (0)