diff --git a/.github/workflows/copybara.yaml b/.github/workflows/copybara.yaml index 2262e72..5d2dba8 100644 --- a/.github/workflows/copybara.yaml +++ b/.github/workflows/copybara.yaml @@ -1,7 +1,7 @@ name: Copybara on: - workflow_dispatch: +# workflow_dispatch: pull_request_target: push: branches: ["alternative-main"] @@ -17,11 +17,17 @@ jobs: # Checkout as many commits as needed for the diff fetch-depth: 2 + - 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 - uses: olivr/copybara-action@v1.2.3 - with: - ssh_key: ${{ secrets.COPYBARA_SSH_KEY }} - access_token: ${{ secrets.COPYBARA_PAT }} - custom_config: copy.bara.sky - workflow: default - copybara_options: ${{ github.event.number }} --force --init-history \ No newline at end of file + # run copybara and pass in the credentials files + run: | + docker run \ + -v "$(pwd)":/usr/src/app \ + -v $HOME/copybara_ssh_key:/root/.ssh/id_rsa \ + -v $HOME/copybara_pat:/root/.git-credentials \ + copybara copy.bara.sky default ${{ github.event.number }} --force --init-history \ No newline at end of file diff --git a/copy.bara.sky b/copy.bara.sky index 4de7a07..5e79c7b 100644 --- a/copy.bara.sky +++ b/copy.bara.sky @@ -12,6 +12,7 @@ core.workflow( destination = git.github_pr_destination( url = sbv3RepoUrl, + destination_ref = 'main', ), origin_files = glob([ "javascript/on-demand/**",