Skip to content

serialize github object #7

serialize github object

serialize github object #7

name: Update Upstream From Fork
on:
push:
branches:
- master
- v1.18
- v1.17
env:
GH_TOKEN: ${{ secrets.SYNC_TEST_ADMIN }}
GH_REPO: ${{ github.repository }}
BASE_REF: ${{ github.event.base_ref}} # TODO this isn't populated
REF: ${{ github.event.REF}}
BEFORE_SHA: ${{ github.event.before }}
LAST_SHA: ${{ github.event.after}}
UPSTREAM: https://github.com/solana-labs/sync_test.git
GITHUB_OBJ: ${{ toJSON(github) }}
jobs:
update-upstream-from-fork:
# TODO need to update this repo name to anza-xyz/agave
if: github.repository == 'willhickey/sync_test'
name: "Update Upstream From Fork"
runs-on: ubuntu-latest
steps:
- name: Echo ENV
# TODO improve logging
run: |
echo "GITHUB_OJB: $GITHUB_OBJ"
echo "GH_REPO: $GH_REPO"
echo "BASE_REF: $BASE_REF"
echo "REF: $REF"
echo "BEFORE_SHA: $BEFORE_SHA"
echo "LAST_SHA: $LAST_SHA"
echo "---------------"
echo "gh auth status"
gh auth status
echo "---------------"
echo "git config -l: "
git config -l
echo "---------------"
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 $UPSTREAM
shell: bash
- name: show remotes and branches
run: |
git remote --verbose
git branch --all
shell: bash
- name: Cherry pick from origin to upstream
run: |
.github/workflows/cherry-pick-from-branch.sh upstream master "$BEFORE_SHA" "$LAST_SHA"
shell: bash
# TODO master is hardcoded in script call above.
# TODO Minimize the PAT permissions