Skip to content

copybara workflow

copybara workflow #11

Workflow file for this run

name: Copybara
on:
pull_request: # TODO: change to pull_request_target
branches:
- main
# push:
# branches: ["alternative-main"]
jobs:
copybara:
name: Sync switchboard-sdk repo with sbv3 main branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
- name: Set up copy.bara.sky
run: |
sed -i 's/PULL_REQUEST_NUMBER/${{ github.event.number }}/g' copy.bara.sky
- name: Set up credentials files
# put the ssh_key and access_token in files
run: |
echo "${{ secrets.COPYBARA_SSH_KEY }}" > $HOME/copybara_ssh_key
echo "https://user:${{ secrets.COPYBARA_PAT }}@github.com" > $HOME/copyabara_pat
- name: Run Copybara
# run copybara and pass in the credentials files
run: |
docker run \
-v "$(pwd)":/usr/src/app \
-v $HOME/.ssh/switchboard-sdk:/root/.ssh/id_rsa \
-v $HOME/switchboard/copybara_pat.txt:/root/.git-credentials \
gesarki/copybara:1.0.0 copy.bara.sky default ${{ github.event.number }} --force --init-history --git-committer-email "[email protected]" --git-committer-name "Github Actions"