mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
chore(deps): update jest to v29 (major) (#825)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: peaceiris <30958501+peaceiris@users.noreply.github.com>
This commit is contained in:
parent
2c6daf7153
commit
fd54e565f4
8133
package-lock.json
generated
8133
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -67,13 +67,13 @@
|
|||||||
"eslint-plugin-jest": "^26.9.0",
|
"eslint-plugin-jest": "^26.9.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"jest": "^26.6.3",
|
"jest": "^29.3.1",
|
||||||
"jest-circus": "^26.6.3",
|
"jest-circus": "^29.3.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lint-staged": "^13.1.0",
|
"lint-staged": "^13.1.0",
|
||||||
"prettier": "2.8.3",
|
"prettier": "2.8.3",
|
||||||
"standard-version": "^9.1.1",
|
"standard-version": "^9.1.1",
|
||||||
"ts-jest": "^26.5.6",
|
"ts-jest": "^29.0.5",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,15 +127,19 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
if (error instanceof Error) {
|
||||||
core.info(`[INFO] ${e.message}`);
|
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||||
await createDir(destDir);
|
core.info(`[INFO] ${error.message}`);
|
||||||
core.info(`[INFO] chdir ${workDir}`);
|
await createDir(destDir);
|
||||||
process.chdir(workDir);
|
core.info(`[INFO] chdir ${workDir}`);
|
||||||
await createBranchForce(inps.PublishBranch);
|
process.chdir(workDir);
|
||||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
await createBranchForce(inps.PublishBranch);
|
||||||
return;
|
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,9 +205,13 @@ export async function commit(allowEmptyCommit: boolean, msg: string): Promise<vo
|
|||||||
} else {
|
} else {
|
||||||
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info('[INFO] skip commit');
|
if (error instanceof Error) {
|
||||||
core.debug(`[INFO] skip commit ${e.message}`);
|
core.info('[INFO] skip commit');
|
||||||
|
core.debug(`[INFO] skip commit ${error.message}`);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,11 @@ import * as main from './main';
|
|||||||
(async (): Promise<void> => {
|
(async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
await main.run();
|
await main.run();
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.setFailed(`Action failed with "${e.message}"`);
|
if (error instanceof Error) {
|
||||||
|
core.setFailed(`Action failed with "${error.message}"`);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
16
src/main.ts
16
src/main.ts
@ -57,8 +57,12 @@ export async function run(): Promise<void> {
|
|||||||
core.startGroup('Setup Git config');
|
core.startGroup('Setup Git config');
|
||||||
try {
|
try {
|
||||||
await exec.exec('git', ['remote', 'rm', 'origin']);
|
await exec.exec('git', ['remote', 'rm', 'origin']);
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info(`[INFO] ${e.message}`);
|
if (error instanceof Error) {
|
||||||
|
core.info(`[INFO] ${error.message}`);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
||||||
await exec.exec('git', ['add', '--all']);
|
await exec.exec('git', ['add', '--all']);
|
||||||
@ -86,7 +90,11 @@ export async function run(): Promise<void> {
|
|||||||
core.info('[INFO] Action successfully completed');
|
core.info('[INFO] Action successfully completed');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
throw new Error(e.message);
|
if (error instanceof Error) {
|
||||||
|
throw new Error(error.message);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,11 @@ export async function setTokens(inps: Inputs): Promise<string> {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error('not found deploy key or tokens');
|
throw new Error('not found deploy key or tokens');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
throw new Error(e.message);
|
if (error instanceof Error) {
|
||||||
|
throw new Error(error.message);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user