Skip to content

Commit 087b24a

Browse files
committed
fix: don't rollback on cnpm sync fail
1 parent 73c5132 commit 087b24a

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
# 支持以下自定义配置,一般用默认值即可
4949
# with:
5050
# os: 'ubuntu-latest, macos-latest, windows-latest'
51-
# version: '16, 18'
51+
# version: '16, 18, 20'
5252
```
5353

5454
### 开启 MySQL 和 Redis 服务依赖

scripts/release/index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
const path = require('path');
22
const fs = require('fs');
33
const core = require('@actions/core');
4-
const { getExecOutput } = require('@actions/exec');
54
const semanticRelease = require('semantic-release');
65
const { request } = require('undici');
76

8-
async function execGit(cmd) {
9-
const { stdout } = await getExecOutput(cmd);
10-
return stdout.trim();
11-
}
12-
137
async function run() {
148
const mainRepoPath = process.cwd();
159
const pkgInfo = require(`${mainRepoPath}/package.json`);
1610
const registry = pkgInfo.publishConfig?.registry || 'https://registry.npmjs.org';
1711
core.setOutput('name', pkgInfo.name);
1812
core.setOutput('registry', registry);
1913

20-
// const lastCommitId = await execGit(`git log -n1 --format="%h"`);
21-
2214
try {
2315
const configFiles = [
2416
path.join(__dirname, 'release.config.js'),
@@ -68,17 +60,7 @@ async function run() {
6860
}
6961
console.log('Result:', result);
7062
} catch (error) {
71-
// console.error('> Rollback to last commit');
72-
// const currentCommitId = await execGit(`git log -n1 --format="%h"`);
73-
// const tagId = await execGit(`git tag --contains ${currentCommitId}`);
74-
75-
// await execGit(`git push --delete origin ${tagId}`);
76-
// await execGit(`git reset --hard ${lastCommitId}`);
77-
// await execGit(`git push --force`);
78-
79-
// console.error('> Rollback finished');
80-
81-
// console.error(error);
63+
console.error(error);
8264
core.setFailed(error);
8365
}
8466
}

0 commit comments

Comments
 (0)