From 155dc12a99b5ad980f3fe243b15c92b8b2c650c3 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Mon, 20 Nov 2023 10:45:35 +0100 Subject: [PATCH] fix: use full ref --- scripts/ci/prepare-scan.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ci/prepare-scan.js b/scripts/ci/prepare-scan.js index 6d04907..1fe0930 100644 --- a/scripts/ci/prepare-scan.js +++ b/scripts/ci/prepare-scan.js @@ -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;