Skip to content

Commit fbfe32c

Browse files
authored
Merge pull request #11 from foooomio/upgrade-dependencies
Upgrade dependencies
2 parents 06e1a38 + c1effc2 commit fbfe32c

File tree

3 files changed

+100
-35
lines changed

3 files changed

+100
-35
lines changed

dist/index.js

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
1616
};
1717
Object.defineProperty(exports, "__esModule", ({ value: true }));
1818
const os = __importStar(__webpack_require__(87));
19+
const utils_1 = __webpack_require__(278);
1920
/**
2021
* Commands
2122
*
@@ -69,28 +70,14 @@ class Command {
6970
return cmdStr;
7071
}
7172
}
72-
/**
73-
* Sanitizes an input into a string so it can be passed into issueCommand safely
74-
* @param input input to sanitize into a string
75-
*/
76-
function toCommandValue(input) {
77-
if (input === null || input === undefined) {
78-
return '';
79-
}
80-
else if (typeof input === 'string' || input instanceof String) {
81-
return input;
82-
}
83-
return JSON.stringify(input);
84-
}
85-
exports.toCommandValue = toCommandValue;
8673
function escapeData(s) {
87-
return toCommandValue(s)
74+
return utils_1.toCommandValue(s)
8875
.replace(/%/g, '%25')
8976
.replace(/\r/g, '%0D')
9077
.replace(/\n/g, '%0A');
9178
}
9279
function escapeProperty(s) {
93-
return toCommandValue(s)
80+
return utils_1.toCommandValue(s)
9481
.replace(/%/g, '%25')
9582
.replace(/\r/g, '%0D')
9683
.replace(/\n/g, '%0A')
@@ -124,6 +111,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
124111
};
125112
Object.defineProperty(exports, "__esModule", ({ value: true }));
126113
const command_1 = __webpack_require__(351);
114+
const file_command_1 = __webpack_require__(717);
115+
const utils_1 = __webpack_require__(278);
127116
const os = __importStar(__webpack_require__(87));
128117
const path = __importStar(__webpack_require__(622));
129118
/**
@@ -150,9 +139,17 @@ var ExitCode;
150139
*/
151140
// eslint-disable-next-line @typescript-eslint/no-explicit-any
152141
function exportVariable(name, val) {
153-
const convertedVal = command_1.toCommandValue(val);
142+
const convertedVal = utils_1.toCommandValue(val);
154143
process.env[name] = convertedVal;
155-
command_1.issueCommand('set-env', { name }, convertedVal);
144+
const filePath = process.env['GITHUB_ENV'] || '';
145+
if (filePath) {
146+
const delimiter = '_GitHubActionsFileCommandDelimeter_';
147+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
148+
file_command_1.issueCommand('ENV', commandValue);
149+
}
150+
else {
151+
command_1.issueCommand('set-env', { name }, convertedVal);
152+
}
156153
}
157154
exports.exportVariable = exportVariable;
158155
/**
@@ -168,7 +165,13 @@ exports.setSecret = setSecret;
168165
* @param inputPath
169166
*/
170167
function addPath(inputPath) {
171-
command_1.issueCommand('add-path', {}, inputPath);
168+
const filePath = process.env['GITHUB_PATH'] || '';
169+
if (filePath) {
170+
file_command_1.issueCommand('PATH', inputPath);
171+
}
172+
else {
173+
command_1.issueCommand('add-path', {}, inputPath);
174+
}
172175
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
173176
}
174177
exports.addPath = addPath;
@@ -330,6 +333,68 @@ exports.getState = getState;
330333

331334
/***/ }),
332335

336+
/***/ 717:
337+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
338+
339+
"use strict";
340+
341+
// For internal use, subject to change.
342+
var __importStar = (this && this.__importStar) || function (mod) {
343+
if (mod && mod.__esModule) return mod;
344+
var result = {};
345+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
346+
result["default"] = mod;
347+
return result;
348+
};
349+
Object.defineProperty(exports, "__esModule", ({ value: true }));
350+
// We use any as a valid input type
351+
/* eslint-disable @typescript-eslint/no-explicit-any */
352+
const fs = __importStar(__webpack_require__(747));
353+
const os = __importStar(__webpack_require__(87));
354+
const utils_1 = __webpack_require__(278);
355+
function issueCommand(command, message) {
356+
const filePath = process.env[`GITHUB_${command}`];
357+
if (!filePath) {
358+
throw new Error(`Unable to find environment variable for file command ${command}`);
359+
}
360+
if (!fs.existsSync(filePath)) {
361+
throw new Error(`Missing file at path: ${filePath}`);
362+
}
363+
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
364+
encoding: 'utf8'
365+
});
366+
}
367+
exports.issueCommand = issueCommand;
368+
//# sourceMappingURL=file-command.js.map
369+
370+
/***/ }),
371+
372+
/***/ 278:
373+
/***/ ((__unused_webpack_module, exports) => {
374+
375+
"use strict";
376+
377+
// We use any as a valid input type
378+
/* eslint-disable @typescript-eslint/no-explicit-any */
379+
Object.defineProperty(exports, "__esModule", ({ value: true }));
380+
/**
381+
* Sanitizes an input into a string so it can be passed into issueCommand safely
382+
* @param input input to sanitize into a string
383+
*/
384+
function toCommandValue(input) {
385+
if (input === null || input === undefined) {
386+
return '';
387+
}
388+
else if (typeof input === 'string' || input instanceof String) {
389+
return input;
390+
}
391+
return JSON.stringify(input);
392+
}
393+
exports.toCommandValue = toCommandValue;
394+
//# sourceMappingURL=utils.js.map
395+
396+
/***/ }),
397+
333398
/***/ 514:
334399
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
335400

package-lock.json

Lines changed: 12 additions & 12 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
},
2121
"homepage": "https://github.com/imas/setup-rdflint#readme",
2222
"dependencies": {
23-
"@actions/core": "^1.2.5",
23+
"@actions/core": "^1.2.6",
2424
"@actions/tool-cache": "^1.6.0",
2525
"node-fetch": "^2.6.1"
2626
},
2727
"devDependencies": {
2828
"@types/node-fetch": "^2.5.7",
29-
"@vercel/ncc": "^0.24.0",
29+
"@vercel/ncc": "^0.24.1",
3030
"husky": "^4.3.0",
31-
"prettier": "^2.1.1",
32-
"typescript": "^4.0.2"
31+
"prettier": "^2.1.2",
32+
"typescript": "^4.0.3"
3333
},
3434
"husky": {
3535
"skipCI": true,

0 commit comments

Comments
 (0)