3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 03:47:20 +00:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

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: [