DEV Community

Will
Will

Posted on

Submission: Copybara Action

My Workflow

Copybara Action; runs https://github.com/google/copybara in GitHub Actions.

Copybara transforms and moves code between repositories.

Previously, you had to build and run Copybara manually on your machine. But I have automated this with GitHub Actions!

Currently, I use the action to sync a private repository with a public one (https://github.com/wilmol/coding-practice-java).

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

GitHub logo will-molloy / copybara-action

Runs https://github.com/google/copybara in GitHub Actions. Copybara transforms and moves code between repositories.

copybara-action

Runs https://github.com/google/copybara in GitHub Actions. Copybara transforms and moves code between repositories.

Usage

Specify will-molloy/copybara-action@v1 as a step in your workflow.yml file, for example:

steps:
  - uses: actions/checkout@v1

  - uses: will-molloy/copybara-action@v1
    with:
      git_name: will-molloy
      git_email: willjoemolloy@gmail.com
      ssh_key: ${{ secrets.SSH_KEY }}
      ssh_known_hosts: ${{ secrets.KNOWN_HOSTS }}

Note, internally the action runs docker (specifically this image) so the step must run on Linux.

Arguments

Input Description Usage
git_name git config username, for authoring with Copybara required
git_email git config email, for authoring with Copybara required
ssh_key ssh public key, for authenticating with Copybara required
ssh_known_hosts ssh known hosts file contents, for authenticating with Copybara required
path copy.bara.sky file path optional (defaults to repo root)

See https://github.com/google/copybara for more details, specifically Using Docker to build and run Copybara.




Additional Resources / Info

As mentioned above, I use the action to sync a private repository with a public one (https://github.com/wilmol/coding-practice-java).

Developed by Will (https://dev.to/wilmol / https://github.com/wilmol) and Ji (https://dev.to/jidevops / https://github.com/JiDevOps).

Top comments (0)