Skip to content

Commit

Permalink
fix: use full ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Szandor72 committed Nov 20, 2023
1 parent ddfbe72 commit 155dc12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/ci/prepare-scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ async function getRangeForDiff() {
const headRef = process.env.GITHUB_HEAD_REF;

if (baseRef && headRef) {
// For PRs, compare head ref with the base ref
return `${baseRef}...${headRef}`;
// Use full ref specifiers for remote branches
const fullBaseRef = `refs/remotes/origin/${baseRef}`;
const fullHeadRef = `refs/remotes/origin/${headRef}`;
return `${fullBaseRef}...${fullHeadRef}`;
} else {
// For direct pushes or other scenarios
const currentCommit = process.env.GITHUB_SHA;
Expand Down

0 comments on commit 155dc12

Please sign in to comment.