From 534a7bb2d91425388d84835f558c95f9487a0df4 Mon Sep 17 00:00:00 2001 From: Jelle van Oosterbosch Date: Sat, 21 Feb 2026 22:53:16 +0100 Subject: [PATCH 1/2] Added debug information --- src/action.ts | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/action.ts b/src/action.ts index df450c4..bbb47b6 100644 --- a/src/action.ts +++ b/src/action.ts @@ -166,14 +166,24 @@ export function run(): void { baseRevision = mergeBase; } } catch (err: unknown) { - if (err instanceof Error) { - console.error('Error finding merge base:', err.message); + // If origin/baseRef fails, try just baseRef + try { + const mergeBase = execSync(`git merge-base "${baseRef}" HEAD`).toString().trim(); + if (mergeBase) { + baseRevision = mergeBase; + } + } catch (err2: unknown) { + if (err instanceof Error) { + console.error('Error finding merge base:', err.message); + } } } // Check if lockfile changed try { - const diff = execSync(`git diff --name-only "${baseRevision}" HEAD`).toString(); + const diffCommand = `git diff --name-only "${baseRevision}" HEAD`; + core.debug(`Running diff command: ${diffCommand}`); + const diff = execSync(diffCommand).toString(); const changedFiles = diff .split('\n') .map((line) => line.trim()) @@ -203,10 +213,15 @@ export function run(): void { // Get base version of lockfile let baseContent = '{}'; try { - baseContent = execSync(`git show "${baseRevision}:${lockfilePath}"`, { + const showCommand = `git show "${baseRevision}:${lockfilePath}"`; + core.debug(`Running show command: ${showCommand}`); + baseContent = execSync(showCommand, { stdio: ['pipe', 'pipe', 'ignore'], }).toString(); - } catch { + } catch (err: unknown) { + if (err instanceof Error) { + core.debug(`Error running git show: ${err.message}`); + } // If it fails, baseContent remains '{}' } From fa48270c5892d4b5b4efdbc4267c713bc85e3488 Mon Sep 17 00:00:00 2001 From: Jelle van Oosterbosch Date: Sat, 21 Feb 2026 22:57:22 +0100 Subject: [PATCH 2/2] Fixed lint errors --- src/action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/action.ts b/src/action.ts index 1977ced..25c6a23 100644 --- a/src/action.ts +++ b/src/action.ts @@ -206,7 +206,7 @@ export function run(): void { if (mergeBase) { baseRevision = mergeBase; } - } catch (err2: unknown) { + } catch { if (err instanceof Error) { console.error('Error finding merge base:', err.message); }