Skip to content

Fix empty base_ref when workflow triggered via workflow_call#16

Merged
gobetti merged 1 commit intomainfrom
fix/workflow-call-base-ref
Mar 3, 2026
Merged

Fix empty base_ref when workflow triggered via workflow_call#16
gobetti merged 1 commit intomainfrom
fix/workflow-call-base-ref

Conversation

@gobetti
Copy link
Contributor

@gobetti gobetti commented Mar 3, 2026

Summary

  • github.base_ref is only populated for pull_request events, not workflow_call
  • This caused git diff origin/...HEAD (bad revision) when the workflow was reused from another repo
  • Falls back to main when base_ref is empty

Test plan

  • Trigger the workflow via workflow_call from another repo and confirm the diff step completes without fatal: bad revision error
  • Confirm normal pull_request trigger still works as before

🤖 Generated with Claude Code

📝 Auto-filled

github.base_ref is only set for pull_request events, causing
'origin/...HEAD' when called via workflow_call. Fall back to 'main'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gobetti gobetti merged commit 0f37f87 into main Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants