Skip to content

Commit

Permalink
fix: error comparing changes from fork PR's
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Dec 12, 2022
1 parent 89237bf commit 49d485f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ inputs:
description: 'Specify a base ref used for comparing changes, when `include-deleted-files` is set to `true`'
required: false
default: ${{ github.base_ref }}
head-repo-fork:
description: 'Specify a boolean indicating a PR from a fork is used for comparing changes, when `include-deleted-files` is set to `true`'
required: false
default: ${{ github.event.pull_request.head.repo.fork }}
sha:
description: 'Specify a current commit SHA used for comparing changes, when `include-deleted-files` is set to `true`'
required: true
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function run(): Promise<void> {
required: true
})
const baseRef = core.getInput('base-ref', {required: false})
const headRepoFork = core.getBooleanInput('head-repo-fork', {required: false})
const sha = core.getInput('sha', {required: includeDeletedFiles})
const baseSha = core.getInput('base-sha', {required: includeDeletedFiles})

Expand Down Expand Up @@ -197,7 +198,7 @@ export async function run(): Promise<void> {
baseSha,
sha,
cwd: workingDirectory,
diff: !baseRef ? '..' : '...'
diff: !baseRef || headRepoFork ? '..' : '...'
})
)
}
Expand Down

0 comments on commit 49d485f

Please sign in to comment.