fix(action image): 安裝 git 供前置遠端驗證使用
This commit is contained in:
+4
-1
@@ -13,7 +13,10 @@ function makeRunner(spawn) {
|
||||
const opts = { cwd, encoding: 'utf8' };
|
||||
if (env) opts.env = env;
|
||||
const result = spawn('git', args, opts);
|
||||
if (result.error) throw result.error;
|
||||
if (result.error) {
|
||||
if (result.error.code === 'ENOENT') throw new Error('找不到 git 指令,請確認 action image 已安裝 git');
|
||||
throw result.error;
|
||||
}
|
||||
if (result.status !== 0) throw new Error((result.stderr || result.stdout || '').trim());
|
||||
return (result.stdout || '').trim();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user