Skip to content

Update script permissions #4

Update script permissions

Update script permissions #4

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
# TODO improve logging
run: |
echo $GH_REPO
echo "gh auth status"
gh auth status
echo "git config -l: "
git config -l
shell: bash
- uses: actions/checkout@v4
with:
# By default checkout only gets 1 commit. We want to cherry-pick
# all the commits from the push, so fetch the entire history
fetch-depth: 0
# By default checkout uses secrets.GITHUB_TOKEN. That token won't
# have any permissions in the upstream repo, so we need to override it
# with a Personal Access Token that can access both repos
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: |
.github/workflows/cherry-pick-from-branch.sh
shell: bash
# TODO add a bunch of debugging prints about the state of commits so if cherry-pick fails we can figure it out.
# TODO Minimize the PAT permissions
# TODO a way to skip a commit (CI migration, etc)
# TODO all referencs to "master" need to be dynamic