-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Bug Report
Description
The action fails when used in GitHub Actions environments with the following error:
Error: Failed to analyze repository changes: Repository validation failed: Git command failed: symbolic-ref refs/remotes/origin/HEAD
Environment
- Platform: GitHub Actions runners (ubuntu-latest)
- Git version: Various (GitHub Actions default)
- Action version: v1.0.0
Steps to Reproduce
- Set up a workflow using
synctree/releasebot@v1 - Use standard
actions/checkout@v4to checkout repository - Run the action with any configuration
- The action fails during repository validation
Expected Behavior
The action should work properly in GitHub Actions environments without requiring special git configuration.
Actual Behavior
The action crashes with a git symbolic-ref error during the repository validation phase.
Root Cause
GitHub Actions checkout action doesn't automatically set up the symbolic reference refs/remotes/origin/HEAD that points to the default branch. The current code assumes this reference exists:
const defaultBranch = this.executeGitCommand('symbolic-ref refs/remotes/origin/HEAD')
.replace('refs/remotes/origin/', '')
.trim();When this command fails, the entire repository validation fails, preventing the action from running.
Impact
- ❌ Action is unusable in standard GitHub Actions workflows
- ❌ No fallback mechanism for determining default branch
- ❌ Poor user experience for developers trying to use the action
Proposed Solution
Implement a more robust default branch detection with fallback strategies:
- Try symbolic-ref (current approach)
- Use current branch if available
- Fallback to 'main' as default
This approach ensures the action works in all environments while maintaining functionality.
Additional Context
This is a common issue with GitHub Actions environments where git repositories are cloned with specific configurations that may not include all traditional git references.
Labels: bug, github-actions, priority-high