From 7614d67ab979755ad302852740d2f75cf258aded Mon Sep 17 00:00:00 2001 From: Scott Prue Date: Tue, 2 May 2023 11:33:40 -0600 Subject: [PATCH 1/2] fix: remove unused output to remove warning --- .github/workflows/release.yml | 4 +- action.yml | 3 -- dist/index.js | 96 ++++++++++++++--------------------- src/coveralls.ts | 5 +- 4 files changed, 43 insertions(+), 65 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8e1133..6fcf3ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3 - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} cache: yarn diff --git a/action.yml b/action.yml index c44b236..b9a513b 100644 --- a/action.yml +++ b/action.yml @@ -25,9 +25,6 @@ inputs: flag-name: description: 'Flag name' required: false -outputs: - coveralls-url: - description: 'URL for Coveralls build' runs: using: 'node16' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index efdab3f..d676983 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2677,6 +2677,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -2702,13 +2706,24 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} //# sourceMappingURL=proxy.js.map /***/ }), @@ -2748,11 +2763,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(7147)); const path = __importStar(__nccwpck_require__(1017)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -2933,12 +2954,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(9491); -const childProcess = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const util_1 = __nccwpck_require__(3837); const ioUtil = __importStar(__nccwpck_require__(1962)); -const exec = util_1.promisify(childProcess.exec); -const execFile = util_1.promisify(childProcess.execFile); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -3019,61 +3036,23 @@ exports.mv = mv; function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } - try { - const cmdPath = ioUtil.getCmdPath(); - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath } - }); - } - else { - yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath } - }); - } - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield execFile(`rm`, [`-rf`, `${inputPath}`]); - } - else { - yield ioUtil.unlink(inputPath); - } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); } }); } @@ -17007,7 +16986,6 @@ const github_1 = __nccwpck_require__(5438); const coveralls_api_1 = __importDefault(__nccwpck_require__(6398)); /** * Report coverage to Coveralls for base branch - * * @param lcovPath - Path to lcov file */ async function reportToCoveralls(lcovPath) { @@ -17035,7 +17013,9 @@ async function reportToCoveralls(lcovPath) { throw new Error(response.message); } core.info(`Successfully uploaded base coverage to Coveralls for branch "${branch}". Coveralls URL: ${response?.url}`); - core.setOutput('coverage-url', response?.url); + // NOTE: Removed because @actions/core uses deprecated set output command internally + // See: https://github.com/actions/toolkit/issues/1336#issuecomment-1502056286 + // core.setOutput('coverage-url', response?.url); } catch (err) { const error = err; diff --git a/src/coveralls.ts b/src/coveralls.ts index 3b2fd18..0189312 100644 --- a/src/coveralls.ts +++ b/src/coveralls.ts @@ -6,7 +6,6 @@ type ActualPostJobResponse = (PostJobResponse & { error: boolean }) | null; /** * Report coverage to Coveralls for base branch - * * @param lcovPath - Path to lcov file */ export async function reportToCoveralls(lcovPath: string) { @@ -49,7 +48,9 @@ export async function reportToCoveralls(lcovPath: string) { core.info( `Successfully uploaded base coverage to Coveralls for branch "${branch}". Coveralls URL: ${response?.url}`, ); - core.setOutput('coverage-url', response?.url); + // NOTE: Removed because @actions/core uses deprecated set output command internally + // See: https://github.com/actions/toolkit/issues/1336#issuecomment-1502056286 + // core.setOutput('coverage-url', response?.url); } catch (err) { const error = err as Error; core.error(`Error uploading lcov to Coveralls: ${error.message}`); From 1814734773cfb3380149db99f07fbf2e943564d1 Mon Sep 17 00:00:00 2001 From: Scott Prue Date: Tue, 2 May 2023 12:18:11 -0600 Subject: [PATCH 2/2] fix: pin --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 317b76b..c257b5b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@side/eslint-config-base": "1.0.0", "@side/eslint-config-jest": "1.0.0", "@side/prettier-config": "1.0.0", - "@side/semantic-config-base": "^0.0.1", + "@side/semantic-config-base": "0.0.1", "@tsconfig/node16": "1.0.3", "@types/jest": "29.5.1", "@types/node": "16.18.25", diff --git a/yarn.lock b/yarn.lock index 22a89d2..ec4c335 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1264,7 +1264,7 @@ __metadata: "@side/eslint-config-base": 1.0.0 "@side/eslint-config-jest": 1.0.0 "@side/prettier-config": 1.0.0 - "@side/semantic-config-base": ^0.0.1 + "@side/semantic-config-base": 0.0.1 "@tsconfig/node16": 1.0.3 "@types/jest": 29.5.1 "@types/node": 16.18.25 @@ -1358,7 +1358,7 @@ __metadata: languageName: node linkType: hard -"@side/semantic-config-base@npm:^0.0.1": +"@side/semantic-config-base@npm:0.0.1": version: 0.0.1 resolution: "@side/semantic-config-base@npm:0.0.1" dependencies: