From 6cf74821215ecf6f6a811009d6eb4b0e15ff3d54 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 09:22:09 -0400 Subject: [PATCH 1/7] rest of dependency upgrades, rebuild --- dist/delete/index.js | 103 +++++++++++--- dist/setup/index.js | 331 +++++++++++++++++++++++++------------------ package-lock.json | 14 +- package.json | 2 +- 4 files changed, 288 insertions(+), 162 deletions(-) diff --git a/dist/delete/index.js b/dist/delete/index.js index d704b42c..3b715cf5 100644 --- a/dist/delete/index.js +++ b/dist/delete/index.js @@ -346,6 +346,32 @@ function copyFile(srcFile, destFile, force) { /***/ }), +/***/ 82: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map + +/***/ }), + /***/ 87: /***/ (function(module) { @@ -353,6 +379,42 @@ module.exports = require("os"); /***/ }), +/***/ 102: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +// For internal use, subject to change. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), + /***/ 129: /***/ (function(module) { @@ -503,6 +565,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); /** * Commands * @@ -556,28 +619,14 @@ class Command { return cmdStr; } } -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; function escapeData(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -611,6 +660,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(431); +const file_command_1 = __webpack_require__(102); +const utils_1 = __webpack_require__(82); const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); /** @@ -637,9 +688,17 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); + const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } } exports.exportVariable = exportVariable; /** @@ -655,7 +714,13 @@ exports.setSecret = setSecret; * @param inputPath */ function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; diff --git a/dist/setup/index.js b/dist/setup/index.js index 6957cb05..34ecd422 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -5819,98 +5819,28 @@ module.exports.compile = compile; /* 80 */, /* 81 */, /* 82 */ -/***/ (function(module, __unusedexports, __webpack_require__) { +/***/ (function(__unusedmodule, exports) { "use strict"; - -var Type = __webpack_require__(945); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); } - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map /***/ }), /* 83 */ @@ -6263,7 +6193,41 @@ module.exports = new Type('tag:yaml.org,2002:set', { /***/ }), /* 101 */, -/* 102 */, +/* 102 */ +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +// For internal use, subject to change. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__webpack_require__(747)); +const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); +} +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), /* 103 */, /* 104 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -17549,6 +17513,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const os = __importStar(__webpack_require__(87)); +const utils_1 = __webpack_require__(82); /** * Commands * @@ -17602,28 +17567,14 @@ class Command { return cmdStr; } } -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; function escapeData(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return toCommandValue(s) + return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -20018,6 +19969,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = __webpack_require__(431); +const file_command_1 = __webpack_require__(102); +const utils_1 = __webpack_require__(82); const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); /** @@ -20044,9 +19997,17 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); + const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); + } + else { + command_1.issueCommand('set-env', { name }, convertedVal); + } } exports.exportVariable = exportVariable; /** @@ -20062,7 +20023,13 @@ exports.setSecret = setSecret; * @param inputPath */ function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); + } + else { + command_1.issueCommand('add-path', {}, inputPath); + } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; @@ -20401,7 +20368,47 @@ module.exports = Symbol; /***/ }), /* 499 */, /* 500 */, -/* 501 */, +/* 501 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +"use strict"; + + +var Mixin = __webpack_require__(785), + inherits = __webpack_require__(669).inherits; + +var LocationInfoOpenElementStackMixin = module.exports = function (stack, options) { + Mixin.call(this, stack); + + this.onItemPop = options.onItemPop; +}; + +inherits(LocationInfoOpenElementStackMixin, Mixin); + +LocationInfoOpenElementStackMixin.prototype._getOverriddenMethods = function (mxn, orig) { + return { + pop: function () { + mxn.onItemPop(this.current); + orig.pop.call(this); + }, + + popAllUpToHtmlElement: function () { + for (var i = this.stackTop; i > 0; i--) + mxn.onItemPop(this.items[i]); + + orig.popAllUpToHtmlElement.call(this); + }, + + remove: function (element) { + mxn.onItemPop(this.current); + orig.remove.call(this, element); + } + }; +}; + + + +/***/ }), /* 502 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -27754,7 +27761,7 @@ module.exports = new Schema({ __webpack_require__(611) ], implicit: [ - __webpack_require__(82), + __webpack_require__(841), __webpack_require__(633) ], explicit: [ @@ -29134,7 +29141,7 @@ module.exports = defaults; /* 771 */ /***/ (function(module) { -module.exports = {"_from":"cheerio@^1.0.0-rc.2","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"cheerio@^1.0.0-rc.2","name":"cheerio","escapedName":"cheerio","rawSpec":"^1.0.0-rc.2","saveSpec":null,"fetchSpec":"^1.0.0-rc.2"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_shasum":"094636d425b2e9c0f4eb91a46c05630c9a1a8bf6","_spec":"cheerio@^1.0.0-rc.2","_where":"/Users/goanpeca/Dropbox (Personal)/develop/quansight/setup-miniconda/node_modules/get-hrefs","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"bundleDependencies":false,"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"deprecated":false,"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"}; +module.exports = {"_args":[["cheerio@1.0.0-rc.3","/home/weg/projects/actions/setup-miniconda"]],"_from":"cheerio@1.0.0-rc.3","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"cheerio@1.0.0-rc.3","name":"cheerio","escapedName":"cheerio","rawSpec":"1.0.0-rc.3","saveSpec":null,"fetchSpec":"1.0.0-rc.3"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_spec":"1.0.0-rc.3","_where":"/home/weg/projects/actions/setup-miniconda","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"}; /***/ }), /* 772 */ @@ -30993,38 +31000,92 @@ module.exports = baseIsEqualDeep; "use strict"; -var Mixin = __webpack_require__(785), - inherits = __webpack_require__(669).inherits; +var Type = __webpack_require__(945); -var LocationInfoOpenElementStackMixin = module.exports = function (stack, options) { - Mixin.call(this, stack); +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day - this.onItemPop = options.onItemPop; -}; +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute -inherits(LocationInfoOpenElementStackMixin, Mixin); +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} -LocationInfoOpenElementStackMixin.prototype._getOverriddenMethods = function (mxn, orig) { - return { - pop: function () { - mxn.onItemPop(this.current); - orig.pop.call(this); - }, +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; - popAllUpToHtmlElement: function () { - for (var i = this.stackTop; i > 0; i--) - mxn.onItemPop(this.items[i]); + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - orig.popAllUpToHtmlElement.call(this); - }, + if (match === null) throw new Error('Date resolve error'); - remove: function (element) { - mxn.onItemPop(this.current); - orig.remove.call(this, element); - } - }; -}; + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); /***/ }), @@ -32065,7 +32126,7 @@ var Mixin = __webpack_require__(785), Tokenizer = __webpack_require__(990), LocationInfoTokenizerMixin = __webpack_require__(991), PositionTrackingPreprocessorMixin = __webpack_require__(524), - LocationInfoOpenElementStackMixin = __webpack_require__(841), + LocationInfoOpenElementStackMixin = __webpack_require__(501), HTML = __webpack_require__(621), inherits = __webpack_require__(669).inherits; diff --git a/package-lock.json b/package-lock.json index c8234ab9..3c63f322 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "action-setup-conda", - "version": "1.6.0", + "version": "1.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@actions/core": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz", - "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", + "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" }, "@actions/exec": { "version": "1.0.4", @@ -6712,9 +6712,9 @@ "dev": true }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "dev": true }, "node-fetch-npm": { diff --git a/package.json b/package.json index a6259e3c..1d3502c6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/goanpeca/action-setup-conda#readme", "dependencies": { - "@actions/core": "^1.0.0", + "@actions/core": "^1.2.6", "@actions/exec": "^1.0.2", "@actions/io": "^1.0.1", "@actions/tool-cache": "^1.1.2", From 3ba87a79cbd32ddaa65541fc2d69a8f6214e4d34 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 09:58:42 -0400 Subject: [PATCH 2/7] ignore bash warnings from installers --- dist/setup/index.js | 21 ++++++++++++++++----- src/setup.ts | 24 +++++++++++++++++------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 34ecd422..7765441b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -21331,6 +21331,17 @@ const OS_NAMES = { darwin: "MacOSX", linux: "Linux" }; +/** + * errors that are always probably spurious + */ +const IGNORED_ERRORS = [ + // appear on win install, we can swallow them + /menuinst_win32/, + /Unable to register environment/, + /0%\|/, + // appear on certain Linux/OSX installers + /Please run using "bash"/ +]; /** * Run exec.exec with error handling */ @@ -21344,12 +21355,12 @@ function execute(command) { }, stderr: (data) => { stringData = data.toString(); - // These warnings are appearing on win install, we can swallow them - if (!stringData.includes("menuinst_win32") && - !stringData.includes("Unable to register environment") && - !stringData.includes("0%|")) { - core.warning(stringData); + for (const ignore in IGNORED_ERRORS) { + if (stringData.match(ignore) != null) { + return; + } } + core.warning(stringData); } }; try { diff --git a/src/setup.ts b/src/setup.ts index 95ee4580..0bc5badd 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -60,6 +60,18 @@ const OS_NAMES: IOperatingSystems = { linux: "Linux" }; +/** + * errors that are always probably spurious + */ +const IGNORED_ERRORS = [ + // appear on win install, we can swallow them + /menuinst_win32/, + /Unable to register environment/, + /0%\|/, + // appear on certain Linux/OSX installers + /Please run using "bash"/ +]; + /** * Run exec.exec with error handling */ @@ -72,14 +84,12 @@ async function execute(command: string): Promise { }, stderr: (data: Buffer) => { stringData = data.toString(); - // These warnings are appearing on win install, we can swallow them - if ( - !stringData.includes("menuinst_win32") && - !stringData.includes("Unable to register environment") && - !stringData.includes("0%|") - ) { - core.warning(stringData); + for (const ignore in IGNORED_ERRORS) { + if (stringData.match(ignore) != null) { + return; + } } + core.warning(stringData); } }; From e2dcc395deaef79739e3ebb95ee53576b99166cc Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 10:15:48 -0400 Subject: [PATCH 3/7] linting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f65a2b83..dc02ec59 100644 --- a/README.md +++ b/README.md @@ -270,15 +270,15 @@ name: "Example 7: Explicit Environment Specification" on: pull_request: branches: - - '*' + - "*" push: branches: - - 'master' + - "master" jobs: example-7: name: Ex7 Explicit - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v2 - uses: conda-incubator/setup-miniconda@v1 From 63aed4fc9fb51ae183cf6c596dce32534d6efb45 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 10:26:27 -0400 Subject: [PATCH 4/7] use String.includes instead of match --- src/setup.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/setup.ts b/src/setup.ts index 7078dce3..8f4e2989 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -65,11 +65,11 @@ const OS_NAMES: IOperatingSystems = { */ const IGNORED_ERRORS = [ // appear on win install, we can swallow them - /menuinst_win32/, - /Unable to register environment/, - /0%\|/, + `menuinst_win32`, + `Unable to register environment`, + `0%|`, // appear on certain Linux/OSX installers - /Please run using "bash"/ + `Please run using "bash"` ]; /** @@ -85,7 +85,7 @@ async function execute(command: string): Promise { stderr: (data: Buffer) => { stringData = data.toString(); for (const ignore in IGNORED_ERRORS) { - if (stringData.match(ignore) != null) { + if (stringData.includes(ignore)) { return; } } From 0528100674086e3dedfe863c9033115156e34945 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 10:36:07 -0400 Subject: [PATCH 5/7] more work on ignoring bash warnings --- dist/setup/index.js | 69 ++++++++++++++++++++++----------------------- src/setup.ts | 25 ++++++++-------- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index f6c71bea..2b1c3f43 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -12266,7 +12266,7 @@ module.exports = baseIsNative; "use strict"; -var ReadableStream = __webpack_require__(794).Readable, +var ReadableStream = __webpack_require__(413).Readable, inherits = __webpack_require__(669).inherits, Serializer = __webpack_require__(748); @@ -17084,7 +17084,7 @@ module.exports = overArg; "use strict"; -var WritableStream = __webpack_require__(794).Writable, +var WritableStream = __webpack_require__(413).Writable, inherits = __webpack_require__(669).inherits, Parser = __webpack_require__(60); @@ -17325,10 +17325,9 @@ module.exports = baseIsTypedArray; /***/ }), /* 413 */ -/***/ (function(module, __unusedexports, __webpack_require__) { - -module.exports = __webpack_require__(141); +/***/ (function(module) { +module.exports = require("stream"); /***/ }), /* 414 */ @@ -17418,7 +17417,7 @@ module.exports = Set; /* 427 */ /***/ (function(module, __unusedexports, __webpack_require__) { -module.exports = __webpack_require__(794); +module.exports = __webpack_require__(413); /***/ }), @@ -21304,6 +21303,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const fs = __importStar(__webpack_require__(747)); const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); +const stream = __importStar(__webpack_require__(413)); const core = __importStar(__webpack_require__(470)); const exec = __importStar(__webpack_require__(986)); const io = __importStar(__webpack_require__(1)); @@ -21334,33 +21334,31 @@ const OS_NAMES = { /** * errors that are always probably spurious */ -const IGNORED_ERRORS = [ +const IGNORED_WARNINGS = [ // appear on win install, we can swallow them - /menuinst_win32/, - /Unable to register environment/, - /0%\|/, + `menuinst_win32`, + `Unable to register environment`, + `0%|`, // appear on certain Linux/OSX installers - /Please run using "bash"/ + `Please run using "bash"` ]; /** * Run exec.exec with error handling */ function execute(command) { return __awaiter(this, void 0, void 0, function* () { - let options = { listeners: {} }; - let stringData; - options.listeners = { - stdout: (data) => { - // core.info(data.toString()); - }, - stderr: (data) => { - stringData = data.toString(); - for (const ignore in IGNORED_ERRORS) { - if (stringData.match(ignore) != null) { - return; + let options = { + errStream: new stream.Writable(), + listeners: { + stderr: (data) => { + const stringData = data.toString(); + for (const ignore of IGNORED_WARNINGS) { + if (stringData.includes(ignore)) { + return; + } } + core.warning(stringData); } - core.warning(stringData); } }; try { @@ -22144,7 +22142,7 @@ const os = __importStar(__webpack_require__(87)); const path = __importStar(__webpack_require__(622)); const httpm = __importStar(__webpack_require__(539)); const semver = __importStar(__webpack_require__(280)); -const stream = __importStar(__webpack_require__(794)); +const stream = __importStar(__webpack_require__(413)); const util = __importStar(__webpack_require__(669)); const v4_1 = __importDefault(__webpack_require__(826)); const exec_1 = __webpack_require__(986); @@ -23147,7 +23145,7 @@ class HttpClient { if (useProxy) { // If using proxy, need tunnel if (!tunnel) { - tunnel = __webpack_require__(413); + tunnel = __webpack_require__(856); } const agentOptions = { maxSockets: maxSockets, @@ -25200,7 +25198,7 @@ module.exports = new Type('tag:yaml.org,2002:merge', { "use strict"; -var WritableStream = __webpack_require__(794).Writable, +var WritableStream = __webpack_require__(413).Writable, util = __webpack_require__(669); var DevNullStream = module.exports = function () { @@ -26337,7 +26335,7 @@ module.exports = basePropertyDeep; /* 681 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(794); +var Stream = __webpack_require__(413); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); @@ -29504,12 +29502,7 @@ module.exports = baseFilter; /***/ }), -/* 794 */ -/***/ (function(module) { - -module.exports = require("stream"); - -/***/ }), +/* 794 */, /* 795 */ /***/ (function(module) { @@ -32607,7 +32600,13 @@ module.exports = { /***/ }), -/* 856 */, +/* 856 */ +/***/ (function(module, __unusedexports, __webpack_require__) { + +module.exports = __webpack_require__(141); + + +/***/ }), /* 857 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -34341,7 +34340,7 @@ module.exports = wrapperClone; "use strict"; -var TransformStream = __webpack_require__(794).Transform, +var TransformStream = __webpack_require__(413).Transform, DevNullStream = __webpack_require__(636), inherits = __webpack_require__(669).inherits, Tokenizer = __webpack_require__(990), diff --git a/src/setup.ts b/src/setup.ts index 8f4e2989..b4a9293c 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -1,6 +1,7 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; +import * as stream from "stream"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; @@ -63,7 +64,7 @@ const OS_NAMES: IOperatingSystems = { /** * errors that are always probably spurious */ -const IGNORED_ERRORS = [ +const IGNORED_WARNINGS = [ // appear on win install, we can swallow them `menuinst_win32`, `Unable to register environment`, @@ -76,20 +77,18 @@ const IGNORED_ERRORS = [ * Run exec.exec with error handling */ async function execute(command: string): Promise { - let options = { listeners: {} }; - let stringData: string; - options.listeners = { - stdout: (data: Buffer) => { - // core.info(data.toString()); - }, - stderr: (data: Buffer) => { - stringData = data.toString(); - for (const ignore in IGNORED_ERRORS) { - if (stringData.includes(ignore)) { - return; + let options: exec.ExecOptions = { + errStream: new stream.Writable(), + listeners: { + stderr: (data: Buffer) => { + const stringData = data.toString(); + for (const ignore of IGNORED_WARNINGS) { + if (stringData.includes(ignore)) { + return; + } } + core.warning(stringData); } - core.warning(stringData); } }; From bba6fb75cfdcb12404917c04ce17a75591480bb8 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 10:57:28 -0400 Subject: [PATCH 6/7] try bootstrap condarc --- dist/setup/index.js | 20 +++++++++++++++++--- src/setup.ts | 23 ++++++++++++++++++++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 2b1c3f43..97cae13c 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -21342,6 +21342,14 @@ const IGNORED_WARNINGS = [ // appear on certain Linux/OSX installers `Please run using "bash"` ]; +/** + * avoid spurious conda warnings before we have a chance to update them + */ +const BOOTSTRAP_CONDARC = "notify_outdated_conda: false"; +/** + * the conda config file + */ +const CONDARC_PATH = path.join(os.homedir(), ".condarc"); /** * Run exec.exec with error handling */ @@ -21828,6 +21836,13 @@ function setupMiniconda(installerUrl, minicondaVersion, architecture, condaVersi error: new Error(`"mamba-version=${mambaVersion}" requires "conda-forge" to be included in "channels!"`) }; } + try { + utils.consoleLog(`Creating bootstrap condarc file in ${CONDARC_PATH}...`); + yield fs.promises.writeFile(CONDARC_PATH, BOOTSTRAP_CONDARC); + } + catch (err) { + return { ok: false, error: err }; + } if (installerUrl !== "") { if (minicondaVersion !== "") { return { @@ -21879,11 +21894,10 @@ function setupMiniconda(installerUrl, minicondaVersion, architecture, condaVersi return result; if (condaConfigFile) { utils.consoleLog("Copying condarc file..."); - const destinationPath = path.join(os.homedir(), ".condarc"); const sourcePath = path.join(process.env["GITHUB_WORKSPACE"] || "", condaConfigFile); - core.info(`"${sourcePath}" to "${destinationPath}"`); + core.info(`"${sourcePath}" to "${CONDARC_PATH}"`); try { - yield io.cp(sourcePath, destinationPath); + yield io.cp(sourcePath, CONDARC_PATH); } catch (err) { return { ok: false, error: err }; diff --git a/src/setup.ts b/src/setup.ts index b4a9293c..cc62210c 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -55,6 +55,7 @@ const ARCHITECTURES: IArchitectures = { ARM64: "aarch64", // To be supported by github runners ARM32: "armv7l" // To be supported by github runners }; + const OS_NAMES: IOperatingSystems = { win32: "Windows", darwin: "MacOSX", @@ -73,6 +74,16 @@ const IGNORED_WARNINGS = [ `Please run using "bash"` ]; +/** + * avoid spurious conda warnings before we have a chance to update them + */ +const BOOTSTRAP_CONDARC = "notify_outdated_conda: false"; + +/** + * the conda config file + */ +const CONDARC_PATH = path.join(os.homedir(), ".condarc"); + /** * Run exec.exec with error handling */ @@ -647,6 +658,13 @@ async function setupMiniconda( }; } + try { + utils.consoleLog(`Creating bootstrap condarc file in ${CONDARC_PATH}...`); + await fs.promises.writeFile(CONDARC_PATH, BOOTSTRAP_CONDARC); + } catch (err) { + return { ok: false, error: err }; + } + if (installerUrl !== "") { if (minicondaVersion !== "") { return { @@ -701,14 +719,13 @@ async function setupMiniconda( if (condaConfigFile) { utils.consoleLog("Copying condarc file..."); - const destinationPath: string = path.join(os.homedir(), ".condarc"); const sourcePath: string = path.join( process.env["GITHUB_WORKSPACE"] || "", condaConfigFile ); - core.info(`"${sourcePath}" to "${destinationPath}"`); + core.info(`"${sourcePath}" to "${CONDARC_PATH}"`); try { - await io.cp(sourcePath, destinationPath); + await io.cp(sourcePath, CONDARC_PATH); } catch (err) { return { ok: false, error: err }; } From a8d9a866c5bb613f455475b111653ea009545b22 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Tue, 6 Oct 2020 11:07:49 -0400 Subject: [PATCH 7/7] also squash old conda warnings for tar_bz2 --- dist/setup/index.js | 4 +++- src/setup.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 97cae13c..bfa0a933 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -21340,7 +21340,9 @@ const IGNORED_WARNINGS = [ `Unable to register environment`, `0%|`, // appear on certain Linux/OSX installers - `Please run using "bash"` + `Please run using "bash"`, + // old condas don't know what to do with these + `Key 'use_only_tar_bz2' is not a known primitive parameter.` ]; /** * avoid spurious conda warnings before we have a chance to update them diff --git a/src/setup.ts b/src/setup.ts index cc62210c..40f592e4 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -71,7 +71,9 @@ const IGNORED_WARNINGS = [ `Unable to register environment`, `0%|`, // appear on certain Linux/OSX installers - `Please run using "bash"` + `Please run using "bash"`, + // old condas don't know what to do with these + `Key 'use_only_tar_bz2' is not a known primitive parameter.` ]; /**