Skip to content

Add fetch-depth: 0

Add fetch-depth: 0 #3

name: Update Upstream From Fork
on:
push:
branches:
- master
- v1.18
- v1.17
env:
GH_TOKEN: ${{ secrets.SYNC_TEST_ADMIN }}
GH_REPO: ${{ github.repository }}
jobs:
update-upstream-from-fork:
name: "Update Upstream From Fork"
runs-on: ubuntu-latest
steps:
- name: Echo ENV
run: |
echo $GH_REPO
gh auth status
echo "git config -l: "
git config -l
shell: bash
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SYNC_TEST_ADMIN }}
- name: Add remote for upstream
run: git remote add upstream https://github.com/solana-labs/sync_test.git
shell: bash
- name: show remotes and branches
run: |
git remote --verbose
git branch --all
shell: bash
- name: Cherry pick from origin/master to upstream/master
run: |
git config --global user.email "[email protected]"
git config --global user.name "GHA: Update Upstream From Fork"
git fetch --all
echo "-------------------------"
echo "git log --oneline remotes/upstream/master:"
git log --oneline remotes/upstream/master
echo "-----------------------\ngit log --oneline origin/master"
git log --oneline origin/master
echo "-------------------------"
git checkout -b temp_branch remotes/upstream/master
git cherry-pick remotes/upstream/master..origin/master
git push upstream master
shell: bash
# TODO add a bunch of debugging prints about the state of commits so if cherry-pick fails we can figure it out.