fix: error fetch more history for release events (#1403)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-07-24 14:34:13 -06:00
committed by GitHub
parent 797a722244
commit fc3c551a67
3 changed files with 29 additions and 16 deletions

View File

@@ -95,9 +95,17 @@ export const getSHAForPushEvent = async (
core.info('Repository is shallow, fetching more history...')
if (isTag) {
const sourceBranch =
github.context.payload.base_ref.replace('refs/heads/', '') ||
github.context.payload.release?.target_commitish
let sourceBranch = ''
if (github.context.payload.base_ref) {
sourceBranch = github.context.payload.base_ref.replace(
'refs/heads/',
''
)
} else if (github.context.payload.release?.target_commitish) {
sourceBranch = github.context.payload.release?.target_commitish
}
await gitFetch({
cwd: workingDirectory,
args: [