-
Notifications
You must be signed in to change notification settings - Fork 276
feat: add base_branch input to specify source branch for new Claude branches #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ranches - Add base_branch input parameter to action.yml allowing users to specify which branch to use as source - Update setupBranch function to accept and use the base branch parameter - Defaults to repository default branch if no base branch is specified - Addresses issue #62 for better branch control Co-authored-by: ashwin-ant <[email protected]>
Claude finished @ashwin-ant's task —— View job Code Review for PR #72Reviewing the Tasks:
Review SummaryThis PR successfully implements the ✅ Strengths
🔍 Code Quality Analysisaction.yml changes ✅
prepare.ts changes ✅
branch.ts changes ✅
🎯 Architecture & DesignThe design is solid and follows the existing codebase patterns:
|
src/github/operations/branch.ts
Outdated
@@ -34,6 +35,9 @@ export async function setupBranch( | |||
repo, | |||
}); | |||
const defaultBranch = repoResponse.data.default_branch; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there's a baseBranch provided let's not even fetch the default branch @claude
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @ashwin-ant's task —— View job
Optimizing branch setup logic ✅
Good catch! I optimized the setupBranch
function to avoid fetching the default branch when baseBranch
is already provided.
Tasks:
- Read current setupBranch implementation
- Identify inefficient default branch fetch
- Refactor to conditionally fetch only when needed
-
Run formatting checks(no Bash access) - Commit optimized code
Optimization completed: Modified the function to only fetch the repository default branch when actually needed:
- When
baseBranch
is provided, we skip the initial default branch fetch - Default branch is only fetched at the very end for return value and GitHub Actions output
- This eliminates an unnecessary API call in the common case where users specify a base branch
Changes pushed to claude/issue-62-20250527_192138
in commit 1fda575
.
Only fetch repository default branch when actually needed: - Skip initial fetch when baseBranch is provided - Fetch default branch at end only for return value and GitHub Actions output - Eliminates unnecessary API call when users specify base branch Co-authored-by: ashwin-ant <[email protected]>
- Fix TypeScript error where defaultBranch was used before being assigned - Replace DEFAULT_BRANCH with BASE_BRANCH in subsequent workflow steps - Update PR creation and branch comparison to use the actual base branch - Ensure custom base_branch input is respected in all operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Move BASE_BRANCH environment variable reading into parseGitHubContext for consistency - Update setupBranch to use context.inputs.baseBranch instead of process.env - Fix test descriptions to correctly reference BASE_BRANCH instead of DEFAULT_BRANCH - Update test environment setup to use BASE_BRANCH 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
@claude did i miss anything here |
Claude finished @ashwin-ant's task —— View job Final Review AnalysisAnalyzing your Tasks:
🎯 Review SummaryAfter thorough analysis, your ✅ What You Got Right
🔍 Edge Cases Covered
🎨 Implementation Qualityaction.yml - Clean input definition with clear description 🚀 What You Could Consider (Optional)
📋 Final VerdictYou haven't missed anything critical. This is a complete, well-implemented feature that:
The implementation is ready for merge! 🎉 |
Implements the ability to specify which branch Claude checks out from when creating new branches.
Changes
base_branch
input parameter to action.ymlUsage
Users can now specify a base branch in their workflow:
Closes #62
Generated with Claude Code