Skip to content

Fix workflow_call diff: detect default branch and fetch it#17

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

Fix workflow_call diff: detect default branch and fetch it#17
gobetti merged 1 commit intomainfrom
fix/workflow-call-base-ref-v2

Conversation

@gobetti
Copy link
Copy Markdown
Contributor

@gobetti gobetti commented Mar 3, 2026

Summary

  • Replaces hardcoded main fallback with git symbolic-ref to detect the actual default branch (handles repos using master or other names)
  • Adds explicit git fetch origin ${BASE_REF} so the ref exists locally before diffing against it

Test plan

  • Trigger via workflow_call from a repo whose default branch is not main — diff step should complete without fatal: bad revision error
  • Confirm normal pull_request trigger still works as before

🤖 Generated with Claude Code

📝 Auto-filled

git symbolic-ref finds the actual default branch name (handles
repos using master or other names), and an explicit git fetch
ensures origin/<base_ref> exists locally before the diff.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gobetti gobetti merged commit a28ecd2 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