|
1 | 1 | const path = require('path'); |
2 | 2 | const fs = require('fs'); |
3 | 3 | const core = require('@actions/core'); |
4 | | -const { getExecOutput } = require('@actions/exec'); |
5 | 4 | const semanticRelease = require('semantic-release'); |
6 | 5 | const { request } = require('undici'); |
7 | 6 |
|
8 | | -async function execGit(cmd) { |
9 | | - const { stdout } = await getExecOutput(cmd); |
10 | | - return stdout.trim(); |
11 | | -} |
12 | | - |
13 | 7 | async function run() { |
14 | 8 | const mainRepoPath = process.cwd(); |
15 | 9 | const pkgInfo = require(`${mainRepoPath}/package.json`); |
16 | 10 | const registry = pkgInfo.publishConfig?.registry || 'https://registry.npmjs.org'; |
17 | 11 | core.setOutput('name', pkgInfo.name); |
18 | 12 | core.setOutput('registry', registry); |
19 | 13 |
|
20 | | - // const lastCommitId = await execGit(`git log -n1 --format="%h"`); |
21 | | - |
22 | 14 | try { |
23 | 15 | const configFiles = [ |
24 | 16 | path.join(__dirname, 'release.config.js'), |
@@ -68,17 +60,7 @@ async function run() { |
68 | 60 | } |
69 | 61 | console.log('Result:', result); |
70 | 62 | } 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); |
82 | 64 | core.setFailed(error); |
83 | 65 | } |
84 | 66 | } |
|
0 commit comments