Skip to content

feat: add pr_message and pr_template options#140

Closed
robcxyz wants to merge 3 commits into
Olivr:mainfrom
sudoblockio:fireboy/copybara-improvements
Closed

feat: add pr_message and pr_template options#140
robcxyz wants to merge 3 commits into
Olivr:mainfrom
sudoblockio:fireboy/copybara-improvements

Conversation

@robcxyz

@robcxyz robcxyz commented Jan 4, 2026

Copy link
Copy Markdown

Pull request

Related issue

Cherry pick of this PR - #139

Motivation and context

Solution

How has this been tested

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the docs/CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

robcxyz and others added 3 commits December 20, 2025 22:21
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
@robcxyz robcxyz closed this Jan 4, 2026
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.

1 participant