fix: error detecting initial commits (#1181)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-05-26 10:48:32 -06:00
committed by GitHub
parent 88fb02bd31
commit 9ad1a5b96a
5 changed files with 39 additions and 29 deletions

View File

@@ -526,15 +526,20 @@ export const gitLsRemote = async ({
}
export const getParentSha = async ({cwd}: {cwd: string}): Promise<string> => {
const {stdout} = await exec.getExecOutput(
const {stdout, exitCode} = await exec.getExecOutput(
'git',
['rev-list', '-n', '1', 'HEAD^'],
{
cwd,
ignoreReturnCode: true,
silent: process.env.RUNNER_DEBUG !== '1'
}
)
if (exitCode !== 0) {
return ''
}
return stdout.trim()
}