feat: add pr_message and pr_template options#140
Closed
robcxyz wants to merge 3 commits into
Closed
Conversation
This commit consolidates bug fixes and enhancements to make the copybara-action more flexible and resolve reported issues. ## Bug Fixes ### 1. Fixed Copybara Options Passing (fixes Olivr#136) **Issue:** Options passed via copybara_options weren't reaching the copybara command **Root Cause:** COPYBARA_OPTIONS was set as environment variable but never used **Fix:** Pass options directly as command line arguments to docker/copybara **Impact:** All copybara CLI options now work correctly ### 2. Fixed Custom Config File Support (fixes Olivr#130) **Issue:** Custom copybara config files caused TypeError crashes **Root Cause:** Action always set COPYBARA_CONFIG env var, conflicting with user configs **Fix:** Detect when user provides config file in options and skip setting env var **Impact:** Users can now successfully use custom .bara.sky files ## Enhancements ### 3. Made SSH Key Optional **Enhancement:** SSH key is no longer required for workflows using HTTPS authentication **Implementation:** Conditionally mount SSH key volume only if key file exists **Benefit:** Enables HTTPS-only workflows without dummy SSH key files ### 4. Support Custom Workflow Names in Options **Enhancement:** Users can specify workflow names directly in copybara_options **Implementation:** Detect 'migrate' or config file in options and skip COPYBARA_WORKFLOW env var **Benefit:** More flexibility for advanced copybara configurations ### 5. Improved Environment Variable Handling **Enhancement:** Cleaner separation between action defaults and user overrides **Implementation:** - COPYBARA_WORKFLOW only set when not provided by user - COPYBARA_CONFIG only set when user hasn't provided custom config **Benefit:** Reduces env var conflicts and improves predictability ## Technical Changes **src/copybara.ts:** - Added detection for workflow names in copybara_options (lines 17, 34-36) - Added detection for config files in copybara_options (lines 72, 86-88) - Changed from -e COPYBARA_OPTIONS to direct argument passing (lines 90-95) - Made SSH key volume mount conditional (lines 67-69) **src/copybaraAction.ts:** - Made SSH key saving conditional at line 142 **dist/index.js:** - Rebuilt distribution with all changes ## Use Cases Enabled 1. **HTTPS-only workflows:** No SSH key required 2. **Custom configs:** Users can provide their own .bara.sky files (Olivr#130) 3. **Custom workflows:** Users can specify workflow names in options 4. **Complex option passing:** All copybara CLI options work correctly (Olivr#136) ## Backward Compatibility All changes are backward compatible. Existing workflows continue to work as before. The improvements only enhance functionality for users who want to: - Skip SSH authentication - Provide custom copybara configs - Use advanced copybara CLI options ## Testing Tested with airbnb/viaduct demo app publishing workflow, which successfully publishes to three external repositories using custom config and options. Fixes Olivr#130 Fixes Olivr#136
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request
Related issue
Cherry pick of this PR - #139
Motivation and context
Solution
How has this been tested
Types of changes
Checklist