diff --git a/.github/workflows/test-post-cleanup.yml b/.github/workflows/test-post-cleanup.yml index 7b4d7c6..b1d8dc7 100644 --- a/.github/workflows/test-post-cleanup.yml +++ b/.github/workflows/test-post-cleanup.yml @@ -15,21 +15,25 @@ jobs: include: - post-cleanup: 'none' mamba-init-block-exists: '' + mamba-activate-exists: '' env-exists: '' root-exists: '' binary-exists: '' - post-cleanup: 'shell-init' mamba-init-block-exists: '! ' + mamba-activate-exists: '! ' env-exists: '' root-exists: '' binary-exists: '' - post-cleanup: 'environment' mamba-init-block-exists: '! ' + mamba-activate-exists: '! ' env-exists: '! ' root-exists: '' binary-exists: '' - post-cleanup: 'all' mamba-init-block-exists: '! ' + mamba-activate-exists: '! ' env-exists: '! ' root-exists: '! ' binary-exists: '! ' @@ -43,6 +47,7 @@ jobs: set -euxo pipefail ${{ matrix.mamba-init-block-exists }}grep -F "mamba initialize" ~/.bash_profile ${{ matrix.mamba-init-block-exists }}grep -F "mamba initialize" ~/.bashrc + ${{ matrix.mamba-activate-exists }}grep -F "mamba activate" ~/.bash_profile ${{ matrix.env-exists }}test -d ~/micromamba/envs/env-name ${{ matrix.root-exists }}test -d ~/micromamba ${{ matrix.binary-exists }}test -f ~/micromamba-bin/micromamba @@ -56,6 +61,7 @@ jobs: set -euxo pipefail grep -F "mamba initialize" ~/.bash_profile grep -F "mamba initialize" ~/.bashrc + grep -F "mamba activate" ~/.bash_profile test -d ~/micromamba/envs/env-name test -d ~/micromamba test -f ~/micromamba-bin/micromamba diff --git a/dist/licenses.txt b/dist/licenses.txt index 1633867..165e929 100644 --- a/dist/licenses.txt +++ b/dist/licenses.txt @@ -1021,30 +1021,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --- -The following software may be included in this product: uuid (3.4.0) +The following software may be included in this product: uuid (8.3.2) This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2010-2016 Robert Kieffer and other contributors +Copyright (c) 2010-2020 Robert Kieffer and other contributors -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- @@ -1752,7 +1740,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- -The following software may be included in this product: tslib (1.14.1) +The following software may be included in this product: tslib (2.6.2) This software contains the following license and notice below: Copyright (c) Microsoft Corporation. diff --git a/dist/post.js b/dist/post.js index 5307e61..87e074e 100644 --- a/dist/post.js +++ b/dist/post.js @@ -1249,14 +1249,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`; - let path4 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path5 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path4 && !path4.startsWith("/")) { - path4 = `/${path4}`; + if (path5 && !path5.startsWith("/")) { + path5 = `/${path5}`; } - url2 = new URL(origin + path4); + url2 = new URL(origin + path5); } return url2; } @@ -2868,19 +2868,19 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/.pnpm/@fastify+busboy@2.1.0/node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename2(path4) { - if (typeof path4 !== "string") { + module2.exports = function basename2(path5) { + if (typeof path5 !== "string") { return ""; } - for (var i = path4.length - 1; i >= 0; --i) { - switch (path4.charCodeAt(i)) { + for (var i = path5.length - 1; i >= 0; --i) { + switch (path5.charCodeAt(i)) { case 47: case 92: - path4 = path4.slice(i + 1); - return path4 === ".." || path4 === "." ? "" : path4; + path5 = path5.slice(i + 1); + return path5 === ".." || path5 === "." ? "" : path5; } } - return path4 === ".." || path4 === "." ? "" : path4; + return path5 === ".." || path5 === "." ? "" : path5; }; } }); @@ -5859,7 +5859,7 @@ var require_request = __commonJS({ } var Request2 = class _Request { constructor(origin, { - path: path4, + path: path5, method, body: body2, headers, @@ -5873,11 +5873,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler) { - if (typeof path4 !== "string") { + if (typeof path5 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { + } else if (path5[0] !== "/" && !(path5.startsWith("http://") || path5.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path4) !== null) { + } else if (invalidPathRegex.exec(path5) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5940,7 +5940,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util4.buildURL(path4, query) : path4; + this.path = query ? util4.buildURL(path5, query) : path5; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6957,9 +6957,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util4.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path4 = search ? `${pathname}${search}` : pathname; + const path5 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path4; + this.opts.path = path5; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8191,7 +8191,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request); return; } - const { body: body2, method, path: path4, host, upgrade, headers, blocking, reset } = request; + const { body: body2, method, path: path5, host, upgrade, headers, blocking, reset } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body2 && typeof body2.read === "function") { body2.read(0); @@ -8241,7 +8241,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path4} HTTP/1.1\r + let header = `${method} ${path5} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8304,7 +8304,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request) { - const { body: body2, method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { body: body2, method, path: path5, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let headers; if (typeof reqHeaders === "string") headers = Request2[kHTTP2CopyHeaders](reqHeaders.trim()); @@ -8350,7 +8350,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path4; + headers[HTTP2_HEADER_PATH] = path5; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body2 && typeof body2.read === "function") { @@ -10586,20 +10586,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path4) { - if (typeof path4 !== "string") { - return path4; + function safeUrl(path5) { + if (typeof path5 !== "string") { + return path5; } - const pathSegments = path4.split("?"); + const pathSegments = path5.split("?"); if (pathSegments.length !== 2) { - return path4; + return path5; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path4, method, body: body2, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path4); + function matchKey(mockDispatch2, { path: path5, method, body: body2, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path5); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body2) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10617,7 +10617,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path5 }) => matchValue(safeUrl(path5), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10654,9 +10654,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path4, method, body: body2, headers, query } = opts; + const { path: path5, method, body: body2, headers, query } = opts; return { - path: path4, + path: path5, method, body: body2, headers, @@ -11105,10 +11105,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path5, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path4, + Path: path5, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -15743,8 +15743,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path4) { - for (const char of path4) { + function validateCookiePath(path5) { + for (const char of path5) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -17460,11 +17460,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path4 = opts.path; + let path5 = opts.path; if (!opts.path.startsWith("/")) { - path4 = `/${path4}`; + path5 = `/${path5}`; } - url2 = new URL(util4.parseOrigin(url2).origin + path4); + url2 = new URL(util4.parseOrigin(url2).origin + path5); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -18696,7 +18696,7 @@ var require_path_utils = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -18706,7 +18706,7 @@ var require_path_utils = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path4.sep); + return pth.replace(/[/\\]/g, path5.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -18777,7 +18777,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os8 = __importStar(require("os")); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -18805,7 +18805,7 @@ var require_core = __commonJS({ } else { command_1.issueCommand("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path4.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath; function getInput(name, options) { @@ -20674,10 +20674,10 @@ var require_posix = __commonJS({ exports2.sync = exports2.isexe = void 0; var fs_1 = require("fs"); var promises_1 = require("fs/promises"); - var isexe = async (path4, options = {}) => { + var isexe = async (path5, options = {}) => { const { ignoreErrors = false } = options; try { - return checkStat(await (0, promises_1.stat)(path4), options); + return checkStat(await (0, promises_1.stat)(path5), options); } catch (e) { const er = e; if (ignoreErrors || er.code === "EACCES") @@ -20686,10 +20686,10 @@ var require_posix = __commonJS({ } }; exports2.isexe = isexe; - var sync = (path4, options = {}) => { + var sync = (path5, options = {}) => { const { ignoreErrors = false } = options; try { - return checkStat((0, fs_1.statSync)(path4), options); + return checkStat((0, fs_1.statSync)(path5), options); } catch (e) { const er = e; if (ignoreErrors || er.code === "EACCES") @@ -20727,10 +20727,10 @@ var require_win32 = __commonJS({ exports2.sync = exports2.isexe = void 0; var fs_1 = require("fs"); var promises_1 = require("fs/promises"); - var isexe = async (path4, options = {}) => { + var isexe = async (path5, options = {}) => { const { ignoreErrors = false } = options; try { - return checkStat(await (0, promises_1.stat)(path4), path4, options); + return checkStat(await (0, promises_1.stat)(path5), path5, options); } catch (e) { const er = e; if (ignoreErrors || er.code === "EACCES") @@ -20739,10 +20739,10 @@ var require_win32 = __commonJS({ } }; exports2.isexe = isexe; - var sync = (path4, options = {}) => { + var sync = (path5, options = {}) => { const { ignoreErrors = false } = options; try { - return checkStat((0, fs_1.statSync)(path4), path4, options); + return checkStat((0, fs_1.statSync)(path5), path5, options); } catch (e) { const er = e; if (ignoreErrors || er.code === "EACCES") @@ -20751,7 +20751,7 @@ var require_win32 = __commonJS({ } }; exports2.sync = sync; - var checkPathExt = (path4, options) => { + var checkPathExt = (path5, options) => { const { pathExt = process.env.PATHEXT || "" } = options; const peSplit = pathExt.split(";"); if (peSplit.indexOf("") !== -1) { @@ -20759,14 +20759,14 @@ var require_win32 = __commonJS({ } for (let i = 0; i < peSplit.length; i++) { const p = peSplit[i].toLowerCase(); - const ext = path4.substring(path4.length - p.length).toLowerCase(); + const ext = path5.substring(path5.length - p.length).toLowerCase(); if (p && ext === p) { return true; } } return false; }; - var checkStat = (stat2, path4, options) => stat2.isFile() && checkPathExt(path4, options); + var checkStat = (stat2, path5, options) => stat2.isFile() && checkPathExt(path5, options); } }); @@ -20985,7 +20985,7 @@ var require_io_util = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; var fs7 = __importStar(require("fs")); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); _a2 = fs7.promises, exports2.chmod = _a2.chmod, exports2.copyFile = _a2.copyFile, exports2.lstat = _a2.lstat, exports2.mkdir = _a2.mkdir, exports2.open = _a2.open, exports2.readdir = _a2.readdir, exports2.readlink = _a2.readlink, exports2.rename = _a2.rename, exports2.rm = _a2.rm, exports2.rmdir = _a2.rmdir, exports2.stat = _a2.stat, exports2.symlink = _a2.symlink, exports2.unlink = _a2.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; @@ -21034,7 +21034,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path4.extname(filePath).toUpperCase(); + const upperExt = path5.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -21058,11 +21058,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path4.dirname(filePath); - const upperName = path4.basename(filePath).toUpperCase(); + const directory = path5.dirname(filePath); + const upperName = path5.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path4.join(directory, actualName); + filePath = path5.join(directory, actualName); break; } } @@ -21162,7 +21162,7 @@ var require_io = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var ioUtil = __importStar(require_io_util()); function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { @@ -21171,7 +21171,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path4.join(dest, path4.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path5.join(dest, path5.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -21183,7 +21183,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path4.relative(source, newDest) === "") { + if (path5.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -21196,7 +21196,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path4.join(dest, path4.basename(source)); + dest = path5.join(dest, path5.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -21207,7 +21207,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path4.dirname(dest)); + yield mkdirP(path5.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -21270,7 +21270,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path4.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path5.delimiter)) { if (extension) { extensions.push(extension); } @@ -21283,12 +21283,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path4.sep)) { + if (tool.includes(path5.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path4.delimiter)) { + for (const p of process.env.PATH.split(path5.delimiter)) { if (p) { directories.push(p); } @@ -21296,7 +21296,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path4.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path5.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -21417,7 +21417,7 @@ var require_toolrunner = __commonJS({ var os8 = __importStar(require("os")); var events = __importStar(require("events")); var child = __importStar(require("child_process")); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var io = __importStar(require_io()); var ioUtil = __importStar(require_io_util()); var timers_1 = require("timers"); @@ -21632,7 +21632,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path4.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path5.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { @@ -22052,7 +22052,7 @@ var require_internal_path_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var assert_1 = __importDefault(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname(p) { @@ -22060,7 +22060,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path4.dirname(p); + let result = path5.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -22098,7 +22098,7 @@ var require_internal_path_helper = __commonJS({ assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path4.sep; + root += path5.sep; } return root + itemPath; } @@ -22136,10 +22136,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path4.sep)) { + if (!p.endsWith(path5.sep)) { return p; } - if (p === path4.sep) { + if (p === path5.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -22488,7 +22488,7 @@ var require_minimatch = __commonJS({ "use strict"; module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path4 = function() { + var path5 = function() { try { return require("path"); } catch (e) { @@ -22496,7 +22496,7 @@ var require_minimatch = __commonJS({ }() || { sep: "/" }; - minimatch.sep = path4.sep; + minimatch.sep = path5.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand = require_brace_expansion(); var plTypes = { @@ -22587,8 +22587,8 @@ var require_minimatch = __commonJS({ if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path4.sep !== "/") { - pattern = pattern.split(path4.sep).join("/"); + if (!options.allowWindowsEscape && path5.sep !== "/") { + pattern = pattern.split(path5.sep).join("/"); } this.options = options; this.set = []; @@ -22965,8 +22965,8 @@ var require_minimatch = __commonJS({ if (f === "/" && partial) return true; var options = this.options; - if (path4.sep !== "/") { - f = f.split(path4.sep).join("/"); + if (path5.sep !== "/") { + f = f.split(path5.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -23110,7 +23110,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var pathHelper = __importStar(require_internal_path_helper()); var assert_1 = __importDefault(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -23125,12 +23125,12 @@ var require_internal_path = __commonJS({ assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path4.sep); + this.segments = itemPath.split(path5.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename2 = path4.basename(remaining); + const basename2 = path5.basename(remaining); this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); @@ -23148,7 +23148,7 @@ var require_internal_path = __commonJS({ assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - assert_1.default(!segment.includes(path4.sep), `Parameter 'itemPath' contains unexpected path separators`); + assert_1.default(!segment.includes(path5.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -23159,12 +23159,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path4.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path5.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path4.sep; + result += path5.sep; } result += this.segments[i]; } @@ -23213,7 +23213,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os8 = __importStar(require("os")); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var pathHelper = __importStar(require_internal_path_helper()); var assert_1 = __importDefault(require("assert")); var minimatch_1 = require_minimatch(); @@ -23242,7 +23242,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir3); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path4.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path5.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -23266,8 +23266,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path4.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path4.sep}`; + if (!itemPath.endsWith(path5.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path5.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -23302,9 +23302,9 @@ var require_internal_pattern = __commonJS({ assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path4.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path5.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path4.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path5.sep}`)) { homedir3 = homedir3 || os8.homedir(); assert_1.default(homedir3, "Unable to determine HOME directory"); assert_1.default(pathHelper.hasAbsoluteRoot(homedir3), `Expected HOME directory to be a rooted path. Actual '${homedir3}'`); @@ -23388,8 +23388,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path4, level) { - this.path = path4; + constructor(path5, level) { + this.path = path5; this.level = level; } }; @@ -23520,7 +23520,7 @@ var require_internal_globber = __commonJS({ var core7 = __importStar(require_core()); var fs7 = __importStar(require("fs")); var globOptionsHelper = __importStar(require_internal_glob_options_helper()); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var patternHelper = __importStar(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -23603,7 +23603,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path4.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path5.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -25146,7 +25146,7 @@ var require_cacheUtils = __commonJS({ var glob = __importStar(require_glob()); var io = __importStar(require_io()); var fs7 = __importStar(require("fs")); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var semver = __importStar(require_semver()); var util4 = __importStar(require("util")); var uuid_1 = require_uuid(); @@ -25166,9 +25166,9 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path4.join(baseLocation, "actions", "temp"); + tempDirectory = path5.join(baseLocation, "actions", "temp"); } - const dest = path4.join(tempDirectory, (0, uuid_1.v4)()); + const dest = path5.join(tempDirectory, (0, uuid_1.v4)()); yield io.mkdirP(dest); return dest; }); @@ -25192,7 +25192,7 @@ var require_cacheUtils = __commonJS({ _c2 = _g.value; _e = false; const file = _c2; - const relativeFile = path4.relative(workspace, file).replace(new RegExp(`\\${path4.sep}`, "g"), "/"); + const relativeFile = path5.relative(workspace, file).replace(new RegExp(`\\${path5.sep}`, "g"), "/"); core7.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -26789,8 +26789,8 @@ function nextPort(tokenizer) { } } function nextPath(tokenizer) { - const path4 = readUntilCharacter(tokenizer, "?"); - tokenizer._currentToken = URLToken.path(path4); + const path5 = readUntilCharacter(tokenizer, "?"); + tokenizer._currentToken = URLToken.path(path5); if (!hasCurrentCharacter(tokenizer)) { tokenizer._currentState = "DONE"; } else { @@ -26980,16 +26980,16 @@ var init_url = __esm({ * Set the path for this URL. If the provided path contains a query, then it will be added to * this URL as well. */ - setPath(path4) { - if (!path4) { + setPath(path5) { + if (!path5) { this._path = void 0; } else { - const schemeIndex = path4.indexOf("://"); + const schemeIndex = path5.indexOf("://"); if (schemeIndex !== -1) { - const schemeStart = path4.lastIndexOf("/", schemeIndex); - this.set(schemeStart === -1 ? path4 : path4.substr(schemeStart + 1), "SCHEME"); + const schemeStart = path5.lastIndexOf("/", schemeIndex); + this.set(schemeStart === -1 ? path5 : path5.substr(schemeStart + 1), "SCHEME"); } else { - this.set(path4, "PATH"); + this.set(path5, "PATH"); } } } @@ -26997,19 +26997,19 @@ var init_url = __esm({ * Append the provided path to this URL's existing path. If the provided path contains a query, * then it will be added to this URL as well. */ - appendPath(path4) { - if (path4) { + appendPath(path5) { + if (path5) { let currentPath = this.getPath(); if (currentPath) { if (!currentPath.endsWith("/")) { currentPath += "/"; } - if (path4.startsWith("/")) { - path4 = path4.substring(1); + if (path5.startsWith("/")) { + path5 = path5.substring(1); } - path4 = currentPath + path4; + path5 = currentPath + path5; } - this.set(path4, "PATH"); + this.set(path5, "PATH"); } } /** @@ -36116,11 +36116,11 @@ var require_mime_types = __commonJS({ } return exts[0]; } - function lookup(path4) { - if (!path4 || typeof path4 !== "string") { + function lookup(path5) { + if (!path5 || typeof path5 !== "string") { return false; } - var extension2 = extname("x." + path4).toLowerCase().substr(1); + var extension2 = extname("x." + path5).toLowerCase().substr(1); if (!extension2) { return false; } @@ -36389,7 +36389,7 @@ var require_form_data = __commonJS({ "use strict"; var CombinedStream = require_combined_stream(); var util4 = require("util"); - var path4 = require("path"); + var path5 = require("path"); var http3 = require("http"); var https3 = require("https"); var parseUrl = require("url").parse; @@ -36516,11 +36516,11 @@ var require_form_data = __commonJS({ FormData2.prototype._getContentDisposition = function(value, options) { var filename, contentDisposition; if (typeof options.filepath === "string") { - filename = path4.normalize(options.filepath).replace(/\\/g, "/"); + filename = path5.normalize(options.filepath).replace(/\\/g, "/"); } else if (options.filename || value.name || value.path) { - filename = path4.basename(options.filename || value.name || value.path); + filename = path5.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty("httpVersion")) { - filename = path4.basename(value.client._httpMessage.path || ""); + filename = path5.basename(value.client._httpMessage.path || ""); } if (filename) { contentDisposition = 'filename="' + filename + '"'; @@ -37797,14 +37797,14 @@ var require_url_state_machine = __commonJS({ return url2.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url2) { - const path4 = url2.path; - if (path4.length === 0) { + const path5 = url2.path; + if (path5.length === 0) { return; } - if (url2.scheme === "file" && path4.length === 1 && isNormalizedWindowsDriveLetter(path4[0])) { + if (url2.scheme === "file" && path5.length === 1 && isNormalizedWindowsDriveLetter(path5[0])) { return; } - path4.pop(); + path5.pop(); } function includesCredentials(url2) { return url2.username !== "" || url2.password !== ""; @@ -63154,10 +63154,10 @@ var init_constants2 = __esm({ // node_modules/.pnpm/@azure+storage-blob@12.17.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.common.js function escapeURLPath(url2) { const urlParsed = URLBuilder.parse(url2); - let path4 = urlParsed.getPath(); - path4 = path4 || "/"; - path4 = escape(path4); - urlParsed.setPath(path4); + let path5 = urlParsed.getPath(); + path5 = path5 || "/"; + path5 = escape(path5); + urlParsed.setPath(path5); return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63239,9 +63239,9 @@ function escape(text) { } function appendToURLPath(url2, name) { const urlParsed = URLBuilder.parse(url2); - let path4 = urlParsed.getPath(); - path4 = path4 ? path4.endsWith("/") ? `${path4}${name}` : `${path4}/${name}` : name; - urlParsed.setPath(path4); + let path5 = urlParsed.getPath(); + path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; + urlParsed.setPath(path5); const normalizedUrl = new URL(urlParsed.toString()); return normalizedUrl.toString(); } @@ -64394,9 +64394,9 @@ var init_StorageSharedKeyCredentialPolicy = __esm({ * @param request - */ getCanonicalizedResourceString(request) { - const path4 = getURLPath(request.url) || "/"; + const path5 = getURLPath(request.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path4}`; + canonicalizedResourceString += `/${this.factory.accountName}${path5}`; const queries = getURLQueries(request.url); const lowercaseQueries = {}; if (queries) { @@ -71257,8 +71257,8 @@ var init_BlobBatch = __esm({ if (this.operationCount >= BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path4 = getURLPath(subRequest.url); - if (!path4 || path4 === "") { + const path5 = getURLPath(subRequest.url); + if (!path5 || path5 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -71353,8 +71353,8 @@ var init_BlobBatchClient = __esm({ pipeline = newPipeline(credentialOrPipeline, options); } const storageClientContext = new StorageClientContext(url2, pipeline.toServiceClientOptions()); - const path4 = getURLPath(url2); - if (path4 && path4 !== "/") { + const path5 = getURLPath(url2); + if (path5 && path5 !== "/") { this.serviceOrContainerContext = new Container(storageClientContext); } else { this.serviceOrContainerContext = new Service(storageClientContext); @@ -74873,7 +74873,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io = __importStar(require_io()); var fs_1 = require("fs"); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var utils = __importStar(require_cacheUtils()); var constants_1 = require_constants5(); var IS_WINDOWS = process.platform === "win32"; @@ -74919,13 +74919,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type4) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path4.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -74971,7 +74971,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -74980,7 +74980,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -74995,7 +74995,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -75004,7 +75004,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -75044,7 +75044,7 @@ var require_tar = __commonJS({ exports2.extractTar = extractTar; function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path4.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path5.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -75119,7 +75119,7 @@ var require_cache2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.ReserveCacheError = exports2.ValidationError = void 0; var core7 = __importStar(require_core()); - var path4 = __importStar(require("path")); + var path5 = __importStar(require("path")); var utils = __importStar(require_cacheUtils()); var cacheHttpClient = __importStar(require_cacheHttpClient()); var tar_1 = require_tar(); @@ -75184,7 +75184,7 @@ var require_cache2 = __commonJS({ core7.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path4.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core7.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core7.isDebug()) { @@ -75227,7 +75227,7 @@ var require_cache2 = __commonJS({ throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path4.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core7.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -75281,7 +75281,7 @@ var require_cache2 = __commonJS({ // src/post.ts var fs6 = __toESM(require("fs/promises")); var os7 = __toESM(require("os")); -var import_path2 = __toESM(require("path")); +var import_path3 = __toESM(require("path")); var import_process = require("process"); var coreDefault5 = __toESM(require_core()); @@ -75323,12 +75323,12 @@ var coreMocked = { getState: (name) => { return process.env[`STATE_${name.replace(/-/g, "_").toUpperCase()}`] || ""; }, - addPath: (path4) => { - console.log(`::add-path::${path4}`); + addPath: (path5) => { + console.log(`::add-path::${path5}`); }, // eslint-disable-next-line @typescript-eslint/no-explicit-any - exportVariable: (path4, value) => { - console.log(`::set-env name=${path4}::${value}`); + exportVariable: (path5, value) => { + console.log(`::set-env name=${path5}::${value}`); } }; @@ -75679,8 +75679,8 @@ function getErrorMap() { return overrideErrorMap; } var makeIssue = (params) => { - const { data, path: path4, errorMaps, issueData } = params; - const fullPath = [...path4, ...issueData.path || []]; + const { data, path: path5, errorMaps, issueData } = params; + const fullPath = [...path5, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -75778,11 +75778,11 @@ var errorUtil; errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; })(errorUtil || (errorUtil = {})); var ParseInputLazyPath = class { - constructor(parent, value, path4, key) { + constructor(parent, value, path5, key) { this._cachedPath = []; this.parent = parent; this.data = value; - this._path = path4; + this._path = path5; this._key = key; } get path() { @@ -81868,7 +81868,9 @@ var getOptions = () => { // src/shell-init.ts var fs3 = __toESM(require("fs/promises")); +var import_fs = require("fs"); var os4 = __toESM(require("os")); +var import_path = __toESM(require("path")); var coreDefault3 = __toESM(require_core()); var core4 = process.env.MOCKING ? coreMocked : coreDefault3; var removeMambaInitBlockFromBashProfile = () => { @@ -81898,11 +81900,44 @@ var shellDeinit = (options, shell) => { } return command; }; +var getRcFileDict = (options) => ({ + bash: PATHS.bashProfile, + zsh: import_path.default.join(os4.homedir(), ".zshrc"), + fish: import_path.default.join(os4.homedir(), ".config", "fish", "config.fish"), + tcsh: import_path.default.join(os4.homedir(), ".tcshrc"), + xonsh: import_path.default.join(os4.homedir(), ".xonshrc"), + "cmd.exe": import_path.default.join(options.micromambaRootPath, "condabin", "mamba_hook.bat"), + powershell: import_path.default.join(os4.homedir(), "Documents", "WindowsPowershell", "profile.ps1"), + pwshWin: import_path.default.join(os4.homedir(), "Documents", "Powershell", "profile.ps1"), + pwshUnix: import_path.default.join(os4.homedir(), ".config", "powershell", "profile.ps1") +}); +var removeEnvironmentFromAutoActivate = (options, environmentName, shell) => { + core4.info(`Removing environment ${environmentName} from auto-activate ${shell} ...`); + if (shell === "powershell") { + core4.warning("powershell is not supported"); + return Promise.resolve(void 0); + } + const rcFilePath = getRcFileDict(options)[shell]; + if ((0, import_fs.existsSync)(rcFilePath)) { + return fs3.readFile(rcFilePath, { encoding: "utf-8" }).then((rcFile) => { + const matches = rcFile.match(new RegExp(`micromamba activate ${environmentName}`)); + if (!matches) { + throw new Error(`Could not find micromamba activate ${environmentName} in ${rcFilePath}`); + } + core4.debug(`Removing micromamba activate ${environmentName} from ${rcFilePath}`); + return fs3.writeFile(rcFilePath, rcFile.replace(matches[0], "")); + }); + } else { + core4.debug(`Could not find ${rcFilePath} to remove micromamba activate ${environmentName} from. + This is because \`micromamba shell deinit -s cmd.exe\` already did that.`); + return Promise.resolve(void 0); + } +}; // src/cache.ts -var import_path = __toESM(require("path")); +var import_path2 = __toESM(require("path")); var fs5 = __toESM(require("fs/promises")); -var import_fs = require("fs"); +var import_fs2 = require("fs"); var cache = __toESM(require_cache2()); var coreDefault4 = __toESM(require_core()); var core5 = process.env.MOCKING ? coreMocked : coreDefault4; @@ -81921,13 +81956,13 @@ var trimPkgsCacheFolder = (cacheFolder) => { return fs5.readdir(cacheFolder).then((files) => { core5.debug(`Files in \`${cacheFolder}\`: ${JSON.stringify(files)}`); return Promise.all( - files.filter((f) => f !== "cache").map((f) => import_path.default.join(cacheFolder, f)).map((f) => fs5.lstat(f).then((stat2) => ({ path: f, stat: stat2 }))) + files.filter((f) => f !== "cache").map((f) => import_path2.default.join(cacheFolder, f)).map((f) => fs5.lstat(f).then((stat2) => ({ path: f, stat: stat2 }))) ); }).then((files) => files.filter((f) => f.stat.isDirectory())).then((dirs) => { - core5.debug(`Directories in \`${cacheFolder}\`: ${JSON.stringify(dirs.map((d) => import_path.default.basename(d.path)))}`); + core5.debug(`Directories in \`${cacheFolder}\`: ${JSON.stringify(dirs.map((d) => import_path2.default.basename(d.path)))}`); return Promise.all( dirs.map((d) => { - core5.info(`Removing \`${import_path.default.basename(d.path)}\``); + core5.info(`Removing \`${import_path2.default.basename(d.path)}\``); return fs5.rm(d.path, { recursive: true, force: true }); }) ); @@ -81938,9 +81973,9 @@ var saveCacheDownloads = (options) => { if (!options.cacheDownloadsKey) { return Promise.resolve(void 0); } - const cachePath = import_path.default.join(options.micromambaRootPath, "pkgs"); + const cachePath = import_path2.default.join(options.micromambaRootPath, "pkgs"); const cacheDownloadsKey = generateDownloadsKey(options.cacheDownloadsKey); - if (!(0, import_fs.existsSync)(cachePath)) { + if (!(0, import_fs2.existsSync)(cachePath)) { core5.debug(`Cache folder \`${cachePath}\` doesn't exist, skipping cache saving.`); return Promise.resolve(void 0); } @@ -81961,7 +81996,7 @@ var removeMicromambaRunShell = (options) => { }; var uninstallEnvironment = (options) => { return determineEnvironmentName(options.environmentName, options.environmentFile).then((environmentName) => { - const envPath = import_path2.default.join(options.micromambaRootPath, "envs", environmentName); + const envPath = import_path3.default.join(options.micromambaRootPath, "envs", environmentName); core6.info(`Removing environment ${environmentName} ...`); core6.debug(`Deleting ${envPath}`); return fs6.rm(envPath, { recursive: true }); @@ -81981,7 +82016,7 @@ var removeCustomCondarc = (options) => { return fs6.rm(options.condarcFile); }; var removeMicromambaBinaryParentIfEmpty = (options) => { - const parentDir = import_path2.default.dirname(options.micromambaBinPath); + const parentDir = import_path3.default.dirname(options.micromambaBinPath); return fs6.readdir(parentDir).then((files) => { if (files.length === 0) { core6.debug(`Deleting ${parentDir}`); @@ -81999,6 +82034,15 @@ var removeMicromambaBinary = (options) => { core6.debug(`Deleting ${options.micromambaBinPath}`); return fs6.rm(options.micromambaBinPath, { force: false }); }; +var removeAutoActivation = (options) => { + if (!options.createEnvironment) { + core6.debug("No environment created. Skipping removal of auto activation line."); + return Promise.resolve(void 0); + } + return determineEnvironmentName(options.environmentName, options.environmentFile).then( + (environmentName) => Promise.all(options.initShell.map((shell) => removeEnvironmentFromAutoActivate(options, environmentName, shell))) + ); +}; var cleanup = (options) => { const postCleanup = options.postCleanup; switch (postCleanup) { @@ -82008,13 +82052,13 @@ var cleanup = (options) => { return Promise.all([ removeMicromambaRunShell(options), ...options.initShell.map((shell) => shellDeinit(options, shell)) - ]).then(() => void 0); + ]).then(() => removeAutoActivation(options)).then(() => void 0); case "environment": return Promise.all([ uninstallEnvironment(options), removeMicromambaRunShell(options), ...options.initShell.map((shell) => shellDeinit(options, shell)) - ]).then(() => void 0); + ]).then(() => removeAutoActivation(options)).then(() => void 0); case "all": return Promise.all(options.initShell.map((shell) => shellDeinit(options, shell))).then( () => ( @@ -82026,7 +82070,7 @@ var cleanup = (options) => { removeCustomCondarc(options) ]) ) - ).then(() => removeMicromambaBinaryParentIfEmpty(options)); + ).then(() => removeAutoActivation(options)).then(() => removeMicromambaBinaryParentIfEmpty(options)); default: throw new Error(`Unknown post cleanup type: ${postCleanup}`); } diff --git a/package.json b/package.json index 1166f1c..73688a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-micromamba", - "version": "1.8.0", + "version": "1.8.1", "private": true, "description": "Action to setup micromamba", "scripts": { diff --git a/src/post.ts b/src/post.ts index 324d408..dabbe50 100644 --- a/src/post.ts +++ b/src/post.ts @@ -6,7 +6,7 @@ import * as coreDefault from '@actions/core' import { coreMocked } from './mocking' import { getOptions, type Options } from './options' import { determineEnvironmentName } from './util' -import { shellDeinit } from './shell-init' +import { removeEnvironmentFromAutoActivate, shellDeinit } from './shell-init' import { saveCacheDownloads } from './cache' const core = process.env.MOCKING ? coreMocked : coreDefault @@ -65,6 +65,16 @@ const removeMicromambaBinary = (options: Options) => { return fs.rm(options.micromambaBinPath, { force: false }) } +const removeAutoActivation = (options: Options) => { + if (!options.createEnvironment) { + core.debug('No environment created. Skipping removal of auto activation line.') + return Promise.resolve(undefined) + } + return determineEnvironmentName(options.environmentName, options.environmentFile).then((environmentName) => + Promise.all(options.initShell.map((shell) => removeEnvironmentFromAutoActivate(options, environmentName, shell))) + ) +} + const cleanup = (options: Options) => { const postCleanup = options.postCleanup switch (postCleanup) { @@ -74,13 +84,17 @@ const cleanup = (options: Options) => { return Promise.all([ removeMicromambaRunShell(options), ...options.initShell.map((shell) => shellDeinit(options, shell)) - ]).then(() => undefined) // output is not used + ]) + .then(() => removeAutoActivation(options)) + .then(() => undefined) // output is not used case 'environment': return Promise.all([ uninstallEnvironment(options), removeMicromambaRunShell(options), ...options.initShell.map((shell) => shellDeinit(options, shell)) - ]).then(() => undefined) // output is not used + ]) + .then(() => removeAutoActivation(options)) + .then(() => undefined) // output is not used case 'all': return Promise.all(options.initShell.map((shell) => shellDeinit(options, shell))) .then(() => @@ -92,6 +106,7 @@ const cleanup = (options: Options) => { removeCustomCondarc(options) ]) ) + .then(() => removeAutoActivation(options)) .then(() => removeMicromambaBinaryParentIfEmpty(options)) default: // This should never happen, because the input is validated in parseInputs diff --git a/src/shell-init.ts b/src/shell-init.ts index 60fe2bf..3b36aa8 100644 --- a/src/shell-init.ts +++ b/src/shell-init.ts @@ -1,4 +1,5 @@ import * as fs from 'fs/promises' +import { existsSync } from 'fs' import * as os from 'os' import path from 'path' import * as coreDefault from '@actions/core' @@ -54,7 +55,7 @@ export const shellInit = (options: Options, shell: string) => { return command.finally(core.endGroup) } -export const shellDeinit = (options: Options, shell: string) => { +export const shellDeinit = (options: Options, shell: ShellType) => { core.startGroup(`Deinitialize micromamba for ${shell}`) const rootPrefixFlag = getRootPrefixFlagForInit(options) const command = execute( @@ -127,12 +128,18 @@ export const removeEnvironmentFromAutoActivate = (options: Options, environmentN const rcFilePath = getRcFileDict(options)[shell] - return fs.readFile(rcFilePath, { encoding: 'utf-8' }).then((rcFile) => { - const matches = rcFile.match(new RegExp(`micromamba activate ${environmentName}`)) - if (!matches) { - throw new Error(`Could not find micromamba activate ${environmentName} in ${rcFilePath}`) - } - core.debug(`Removing micromamba activate ${environmentName} from ${rcFilePath}`) - return fs.writeFile(rcFilePath, rcFile.replace(matches[0], '')) - }) + if (existsSync(rcFilePath)) { + return fs.readFile(rcFilePath, { encoding: 'utf-8' }).then((rcFile) => { + const matches = rcFile.match(new RegExp(`micromamba activate ${environmentName}`)) + if (!matches) { + throw new Error(`Could not find micromamba activate ${environmentName} in ${rcFilePath}`) + } + core.debug(`Removing micromamba activate ${environmentName} from ${rcFilePath}`) + return fs.writeFile(rcFilePath, rcFile.replace(matches[0], '')) + }) + } else { + core.debug(`Could not find ${rcFilePath} to remove micromamba activate ${environmentName} from. + This is because \`micromamba shell deinit -s cmd.exe\` already did that.`) + return Promise.resolve(undefined) + } }