-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.32 KB
/
copybara.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 \
olivr/copybara copy.bara.sky default 2 \
--force \
--init-history \
--git-committer-email "[email protected]" \
--git-committer-name "Github Actions"