Skip to content

Commit

Permalink
Add "Destination" origin to allow cross repo PRs (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchspano committed Dec 4, 2022
1 parent 3763f7a commit df52856
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -58,7 +58,7 @@ jobs:
npm install sfdx-cli
node_modules/sfdx-cli/bin/run plugins:install @salesforce/sfdx-scanner
- name: Run SFDX Scanner - Report findings as comments
uses: mitchspano/sfdx-scan-pull-request@v0.1.3
uses: mitchspano/sfdx-scan-pull-request@v0.1.5
with:
pmdconfig: ruleset.xml
severity-threshold: 4
Expand Down
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -89,7 +89,11 @@ function validatePullRequestContext() {
function getDiffInPullRequest() {
console.log("Getting difference within the pull request...");
execSync(
`git diff origin/${this.pullRequest?.base?.ref}...origin/${this.pullRequest?.head?.ref} > ${DIFF_OUTPUT}`
`git remote add -f destination ${this.pullRequest.base.repo.clone_url}`
);
execSync(`git remote update`);
execSync(
`git diff destination/${this.pullRequest?.base?.ref}...origin/${this.pullRequest?.head?.ref} > ${DIFF_OUTPUT}`
);
const files = parse(fs.readFileSync(DIFF_OUTPUT).toString());
for (let file of files) {
Expand Down

0 comments on commit df52856

Please sign in to comment.