Scan fails when pull request is initiated from a Fork
mitchspano opened this issue · comments
Mitch Spano commented
When the scan is initiated on a fork of the repository, the scan will fail with the following error:
fatal: ambiguous argument 'origin/master...origin/fork-branch-name': unknown revision or path not in the working tree.
Mitch Spano commented
I think we need to to add the target repository as a different remote:
execSync(
`git remote add -f destination ${this.pullRequest.base.repo.git_url}`
);
execSync(`git remote update`);
execSync(
`git diff destination/${this.pullRequest?.base?.ref}...origin/${this.pullRequest?.head?.ref} > ${DIFF_OUTPUT}`
);
Mitch Spano commented