fix dependencies
This commit is contained in:
parent
6ed4ef197b
commit
a5472823b9
|
@ -1554,12 +1554,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.StateCacheStorage = exports.getCommandOutput = void 0;
|
exports.StateCacheStorage = void 0;
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(1017));
|
const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||||
const os_1 = __importDefault(__nccwpck_require__(2037));
|
const os_1 = __importDefault(__nccwpck_require__(2037));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const exec = __importStar(__nccwpck_require__(1514));
|
|
||||||
const github_1 = __nccwpck_require__(5438);
|
const github_1 = __nccwpck_require__(5438);
|
||||||
const plugin_retry_1 = __nccwpck_require__(6298);
|
const plugin_retry_1 = __nccwpck_require__(6298);
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
|
@ -1579,29 +1578,6 @@ const unlinkSafely = (filePath) => {
|
||||||
/* ignore */
|
/* 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 resetCacheWithOctokit = (cacheKey) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
const client = (0, github_1.getOctokit)(token, undefined, plugin_retry_1.retry);
|
const client = (0, github_1.getOctokit)(token, undefined, plugin_retry_1.retry);
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.1",
|
"@actions/cache": "^3.2.1",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
|
||||||
"@actions/github": "^5.1.1",
|
"@actions/github": "^5.1.1",
|
||||||
"@actions/http-client": "^2.1.0",
|
|
||||||
"@octokit/core": "^4.2.0",
|
"@octokit/core": "^4.2.0",
|
||||||
"@octokit/plugin-retry": "^4.1.1",
|
"@octokit/plugin-retry": "^4.1.1",
|
||||||
"lodash.deburr": "^4.1.0",
|
"lodash.deburr": "^4.1.0",
|
||||||
|
|
|
@ -39,9 +39,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.1",
|
"@actions/cache": "^3.2.1",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
|
||||||
"@actions/github": "^5.1.1",
|
"@actions/github": "^5.1.1",
|
||||||
"@actions/http-client": "^2.1.0",
|
|
||||||
"@octokit/core": "^4.2.0",
|
"@octokit/core": "^4.2.0",
|
||||||
"@octokit/plugin-retry": "^4.1.1",
|
"@octokit/plugin-retry": "^4.1.1",
|
||||||
"lodash.deburr": "^4.1.0",
|
"lodash.deburr": "^4.1.0",
|
||||||
|
|
|
@ -3,7 +3,6 @@ import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import {getOctokit} from '@actions/github';
|
import {getOctokit} from '@actions/github';
|
||||||
import {retry as octokitRetry} from '@octokit/plugin-retry';
|
import {retry as octokitRetry} from '@octokit/plugin-retry';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
|
@ -26,37 +25,6 @@ const unlinkSafely = (filePath: string) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCommandOutput = async (
|
|
||||||
toolCommand: string,
|
|
||||||
cwd?: string
|
|
||||||
): Promise<string> => {
|
|
||||||
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<void> {
|
|
||||||
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<void> => {
|
const resetCacheWithOctokit = async (cacheKey: string): Promise<void> => {
|
||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
const client = getOctokit(token, undefined, octokitRetry);
|
const client = getOctokit(token, undefined, octokitRetry);
|
||||||
|
|
|
@ -121,7 +121,7 @@ describe('State', () => {
|
||||||
expect(processedIssuesIDs).toEqual(new Set([1, 2, 3]));
|
expect(processedIssuesIDs).toEqual(new Set([1, 2, 3]));
|
||||||
expect(infoSpy).toHaveBeenCalledTimes(1);
|
expect(infoSpy).toHaveBeenCalledTimes(1);
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
'state: rehydrated with info about 3 issue(s)'
|
'state: restored with info about 3 issue(s)'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue