Skip to content

Commit aabe026

Browse files
committed
Merge remote-tracking branch 'upstream/main' into arch
2 parents 2f532ce + 70b9252 commit aabe026

File tree

8 files changed

+144
-48
lines changed

8 files changed

+144
-48
lines changed

.licenses/npm/@actions/core-1.2.2.dep.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.licenses/npm/@actions/core-1.2.6.dep.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Check latest version:
4747
```yaml
4848
steps:
4949
- uses: actions/checkout@v2
50-
- uses: actions/setup-node@v2
50+
- uses: actions/setup-node@v2-beta
5151
with:
5252
node-version: '12'
5353
check-latest: true

__tests__/authutil.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ describe('authutil tests', () => {
2020
.toString(36)
2121
.substring(7)
2222
);
23+
console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions
24+
process.env['GITHUB_ENV'] = ''; // Stub out Environment file functionality so we can verify it writes to standard out (toolkit is backwards compatible)
2325
const tempDir = path.join(_runnerDir, randPath, 'temp');
2426
await io.rmRF(tempDir);
2527
await io.mkdirP(tempDir);
@@ -61,6 +63,7 @@ describe('authutil tests', () => {
6163
if (_runnerDir) {
6264
await io.rmRF(_runnerDir);
6365
}
66+
console.log('::stoptoken::'); // Re-enable executing of runner commands when running tests in actions
6467
}, 100000);
6568

6669
function readRcFile(rcFile: string) {

__tests__/installer.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ describe('setup-node', () => {
4242

4343
beforeEach(() => {
4444
// @actions/core
45+
console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions
46+
process.env['GITHUB_PATH'] = ''; // Stub out ENV file functionality so we can verify it writes to standard out
4547
inputs = {};
4648
inSpy = jest.spyOn(core, 'getInput');
4749
inSpy.mockImplementation(name => inputs[name]);
@@ -102,7 +104,9 @@ describe('setup-node', () => {
102104
//jest.restoreAllMocks();
103105
});
104106

105-
afterAll(async () => {}, 100000);
107+
afterAll(async () => {
108+
console.log('::stoptoken::'); // Re-enable executing of runner commands when running tests in actions
109+
}, 100000);
106110

107111
//--------------------------------------------------
108112
// Manifest find tests

dist/index.js

Lines changed: 111 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,6 +3028,32 @@ const windowsRelease = release => {
30283028
module.exports = windowsRelease;
30293029

30303030

3031+
/***/ }),
3032+
3033+
/***/ 82:
3034+
/***/ (function(__unusedmodule, exports) {
3035+
3036+
"use strict";
3037+
3038+
// We use any as a valid input type
3039+
/* eslint-disable @typescript-eslint/no-explicit-any */
3040+
Object.defineProperty(exports, "__esModule", { value: true });
3041+
/**
3042+
* Sanitizes an input into a string so it can be passed into issueCommand safely
3043+
* @param input input to sanitize into a string
3044+
*/
3045+
function toCommandValue(input) {
3046+
if (input === null || input === undefined) {
3047+
return '';
3048+
}
3049+
else if (typeof input === 'string' || input instanceof String) {
3050+
return input;
3051+
}
3052+
return JSON.stringify(input);
3053+
}
3054+
exports.toCommandValue = toCommandValue;
3055+
//# sourceMappingURL=utils.js.map
3056+
30313057
/***/ }),
30323058

30333059
/***/ 87:
@@ -3037,6 +3063,42 @@ module.exports = require("os");
30373063

30383064
/***/ }),
30393065

3066+
/***/ 102:
3067+
/***/ (function(__unusedmodule, exports, __webpack_require__) {
3068+
3069+
"use strict";
3070+
3071+
// For internal use, subject to change.
3072+
var __importStar = (this && this.__importStar) || function (mod) {
3073+
if (mod && mod.__esModule) return mod;
3074+
var result = {};
3075+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
3076+
result["default"] = mod;
3077+
return result;
3078+
};
3079+
Object.defineProperty(exports, "__esModule", { value: true });
3080+
// We use any as a valid input type
3081+
/* eslint-disable @typescript-eslint/no-explicit-any */
3082+
const fs = __importStar(__webpack_require__(747));
3083+
const os = __importStar(__webpack_require__(87));
3084+
const utils_1 = __webpack_require__(82);
3085+
function issueCommand(command, message) {
3086+
const filePath = process.env[`GITHUB_${command}`];
3087+
if (!filePath) {
3088+
throw new Error(`Unable to find environment variable for file command ${command}`);
3089+
}
3090+
if (!fs.existsSync(filePath)) {
3091+
throw new Error(`Missing file at path: ${filePath}`);
3092+
}
3093+
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
3094+
encoding: 'utf8'
3095+
});
3096+
}
3097+
exports.issueCommand = issueCommand;
3098+
//# sourceMappingURL=file-command.js.map
3099+
3100+
/***/ }),
3101+
30403102
/***/ 108:
30413103
/***/ (function(module, __unusedexports, __webpack_require__) {
30423104

@@ -8406,6 +8468,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
84068468
};
84078469
Object.defineProperty(exports, "__esModule", { value: true });
84088470
const os = __importStar(__webpack_require__(87));
8471+
const utils_1 = __webpack_require__(82);
84098472
/**
84108473
* Commands
84118474
*
@@ -8460,13 +8523,13 @@ class Command {
84608523
}
84618524
}
84628525
function escapeData(s) {
8463-
return (s || '')
8526+
return utils_1.toCommandValue(s)
84648527
.replace(/%/g, '%25')
84658528
.replace(/\r/g, '%0D')
84668529
.replace(/\n/g, '%0A');
84678530
}
84688531
function escapeProperty(s) {
8469-
return (s || '')
8532+
return utils_1.toCommandValue(s)
84708533
.replace(/%/g, '%25')
84718534
.replace(/\r/g, '%0D')
84728535
.replace(/\n/g, '%0A')
@@ -10391,6 +10454,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
1039110454
};
1039210455
Object.defineProperty(exports, "__esModule", { value: true });
1039310456
const command_1 = __webpack_require__(431);
10457+
const file_command_1 = __webpack_require__(102);
10458+
const utils_1 = __webpack_require__(82);
1039410459
const os = __importStar(__webpack_require__(87));
1039510460
const path = __importStar(__webpack_require__(622));
1039610461
/**
@@ -10413,11 +10478,21 @@ var ExitCode;
1041310478
/**
1041410479
* Sets env variable for this action and future actions in the job
1041510480
* @param name the name of the variable to set
10416-
* @param val the value of the variable
10481+
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
1041710482
*/
10483+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1041810484
function exportVariable(name, val) {
10419-
process.env[name] = val;
10420-
command_1.issueCommand('set-env', { name }, val);
10485+
const convertedVal = utils_1.toCommandValue(val);
10486+
process.env[name] = convertedVal;
10487+
const filePath = process.env['GITHUB_ENV'] || '';
10488+
if (filePath) {
10489+
const delimiter = '_GitHubActionsFileCommandDelimeter_';
10490+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
10491+
file_command_1.issueCommand('ENV', commandValue);
10492+
}
10493+
else {
10494+
command_1.issueCommand('set-env', { name }, convertedVal);
10495+
}
1042110496
}
1042210497
exports.exportVariable = exportVariable;
1042310498
/**
@@ -10433,7 +10508,13 @@ exports.setSecret = setSecret;
1043310508
* @param inputPath
1043410509
*/
1043510510
function addPath(inputPath) {
10436-
command_1.issueCommand('add-path', {}, inputPath);
10511+
const filePath = process.env['GITHUB_PATH'] || '';
10512+
if (filePath) {
10513+
file_command_1.issueCommand('PATH', inputPath);
10514+
}
10515+
else {
10516+
command_1.issueCommand('add-path', {}, inputPath);
10517+
}
1043710518
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
1043810519
}
1043910520
exports.addPath = addPath;
@@ -10456,12 +10537,22 @@ exports.getInput = getInput;
1045610537
* Sets the value of an output.
1045710538
*
1045810539
* @param name name of the output to set
10459-
* @param value value to store
10540+
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
1046010541
*/
10542+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1046110543
function setOutput(name, value) {
1046210544
command_1.issueCommand('set-output', { name }, value);
1046310545
}
1046410546
exports.setOutput = setOutput;
10547+
/**
10548+
* Enables or disables the echoing of commands into stdout for the rest of the step.
10549+
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
10550+
*
10551+
*/
10552+
function setCommandEcho(enabled) {
10553+
command_1.issue('echo', enabled ? 'on' : 'off');
10554+
}
10555+
exports.setCommandEcho = setCommandEcho;
1046510556
//-----------------------------------------------------------------------
1046610557
// Results
1046710558
//-----------------------------------------------------------------------
@@ -10478,6 +10569,13 @@ exports.setFailed = setFailed;
1047810569
//-----------------------------------------------------------------------
1047910570
// Logging Commands
1048010571
//-----------------------------------------------------------------------
10572+
/**
10573+
* Gets whether Actions Step Debug is on or not
10574+
*/
10575+
function isDebug() {
10576+
return process.env['RUNNER_DEBUG'] === '1';
10577+
}
10578+
exports.isDebug = isDebug;
1048110579
/**
1048210580
* Writes debug message to user log
1048310581
* @param message debug message
@@ -10488,18 +10586,18 @@ function debug(message) {
1048810586
exports.debug = debug;
1048910587
/**
1049010588
* Adds an error issue
10491-
* @param message error issue message
10589+
* @param message error issue message. Errors will be converted to string via toString()
1049210590
*/
1049310591
function error(message) {
10494-
command_1.issue('error', message);
10592+
command_1.issue('error', message instanceof Error ? message.toString() : message);
1049510593
}
1049610594
exports.error = error;
1049710595
/**
1049810596
* Adds an warning issue
10499-
* @param message warning issue message
10597+
* @param message warning issue message. Errors will be converted to string via toString()
1050010598
*/
1050110599
function warning(message) {
10502-
command_1.issue('warning', message);
10600+
command_1.issue('warning', message instanceof Error ? message.toString() : message);
1050310601
}
1050410602
exports.warning = warning;
1050510603
/**
@@ -10557,8 +10655,9 @@ exports.group = group;
1055710655
* Saves state for current action, the state can only be retrieved by this action's post job execution.
1055810656
*
1055910657
* @param name name of the state to store
10560-
* @param value value to store
10658+
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
1056110659
*/
10660+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1056210661
function saveState(name, value) {
1056310662
command_1.issueCommand('save-state', { name }, value);
1056410663
}

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"author": "GitHub",
2424
"license": "MIT",
2525
"dependencies": {
26-
"@actions/core": "^1.2.2",
26+
"@actions/core": "^1.2.6",
2727
"@actions/exec": "^1.0.3",
2828
"@actions/github": "^1.1.0",
2929
"@actions/http-client": "^1.0.6",

0 commit comments

Comments
 (0)