diff --git a/dist/index.js b/dist/index.js index c8f5fa19..f964b453 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1554,12 +1554,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StateCacheStorage = exports.getCommandOutput = void 0; +exports.StateCacheStorage = void 0; const fs_1 = __importDefault(__nccwpck_require__(7147)); const path_1 = __importDefault(__nccwpck_require__(1017)); const os_1 = __importDefault(__nccwpck_require__(2037)); const core = __importStar(__nccwpck_require__(2186)); -const exec = __importStar(__nccwpck_require__(1514)); const github_1 = __nccwpck_require__(5438); const plugin_retry_1 = __nccwpck_require__(6298); const cache = __importStar(__nccwpck_require__(7799)); @@ -1579,29 +1578,6 @@ const unlinkSafely = (filePath) => { /* ignore */ } }; -const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () { - let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd }))); - if (exitCode) { - stderr = !stderr.trim() - ? `The '${toolCommand}' command failed with exit code: ${exitCode}` - : stderr; - throw new Error(stderr); - } - return stdout.trim(); -}); -exports.getCommandOutput = getCommandOutput; -function execCommands(commands, cwd) { - return __awaiter(this, void 0, void 0, function* () { - for (const command of commands) { - try { - yield exec.exec(command, undefined, { cwd }); - } - catch (error) { - throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`); - } - } - }); -} const resetCacheWithOctokit = (cacheKey) => __awaiter(void 0, void 0, void 0, function* () { const token = core.getInput('repo-token'); const client = (0, github_1.getOctokit)(token, undefined, plugin_retry_1.retry); diff --git a/package-lock.json b/package-lock.json index 149521d9..cf3f5b40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,7 @@ "dependencies": { "@actions/cache": "^3.2.1", "@actions/core": "^1.10.0", - "@actions/exec": "^1.1.1", "@actions/github": "^5.1.1", - "@actions/http-client": "^2.1.0", "@octokit/core": "^4.2.0", "@octokit/plugin-retry": "^4.1.1", "lodash.deburr": "^4.1.0", diff --git a/package.json b/package.json index d827cd00..f2c23d65 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,7 @@ "dependencies": { "@actions/cache": "^3.2.1", "@actions/core": "^1.10.0", - "@actions/exec": "^1.1.1", "@actions/github": "^5.1.1", - "@actions/http-client": "^2.1.0", "@octokit/core": "^4.2.0", "@octokit/plugin-retry": "^4.1.1", "lodash.deburr": "^4.1.0", diff --git a/src/classes/state/state-cache-storage.ts b/src/classes/state/state-cache-storage.ts index 7510a02d..c4e72b83 100644 --- a/src/classes/state/state-cache-storage.ts +++ b/src/classes/state/state-cache-storage.ts @@ -3,7 +3,6 @@ import fs from 'fs'; import path from 'path'; import os from 'os'; import * as core from '@actions/core'; -import * as exec from '@actions/exec'; import {getOctokit} from '@actions/github'; import {retry as octokitRetry} from '@octokit/plugin-retry'; import * as cache from '@actions/cache'; @@ -26,37 +25,6 @@ const unlinkSafely = (filePath: string) => { } }; -export const getCommandOutput = async ( - toolCommand: string, - cwd?: string -): Promise => { - let {stdout, stderr, exitCode} = await exec.getExecOutput( - toolCommand, - undefined, - {ignoreReturnCode: true, ...(cwd && {cwd})} - ); - - if (exitCode) { - stderr = !stderr.trim() - ? `The '${toolCommand}' command failed with exit code: ${exitCode}` - : stderr; - throw new Error(stderr); - } - - return stdout.trim(); -}; -async function execCommands(commands: string[], cwd?: string): Promise { - for (const command of commands) { - try { - await exec.exec(command, undefined, {cwd}); - } catch (error) { - throw new Error( - `${command.split(' ')[0]} failed with error: ${error?.message}` - ); - } - } -} - const resetCacheWithOctokit = async (cacheKey: string): Promise => { const token = core.getInput('repo-token'); const client = getOctokit(token, undefined, octokitRetry); diff --git a/src/classes/state/state.spec.ts b/src/classes/state/state.spec.ts index f8b90fa5..1a19efc0 100644 --- a/src/classes/state/state.spec.ts +++ b/src/classes/state/state.spec.ts @@ -121,7 +121,7 @@ describe('State', () => { expect(processedIssuesIDs).toEqual(new Set([1, 2, 3])); expect(infoSpy).toHaveBeenCalledTimes(1); expect(infoSpy).toHaveBeenCalledWith( - 'state: rehydrated with info about 3 issue(s)' + 'state: restored with info about 3 issue(s)' ); }); });