From bdea303f1a2fbb79da93346e8aeec195c0d5ca99 Mon Sep 17 00:00:00 2001 From: Brad House Date: Wed, 27 Nov 2024 17:40:38 -0500 Subject: [PATCH] script to sync with upstream --- .github/workflows/sync_upstream.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/sync_upstream.yml diff --git a/.github/workflows/sync_upstream.yml b/.github/workflows/sync_upstream.yml new file mode 100644 index 000000000..1bf2364ea --- /dev/null +++ b/.github/workflows/sync_upstream.yml @@ -0,0 +1,38 @@ +name: 'Sync With Upstream' + +on: + schedule: + - cron: '0 0 * * *' + tags-ignore: + - '**' + workflow_dispatch: + +jobs: + sync_latest_from_upstream: + runs-on: ubuntu-latest + name: Sync latest commits from upstream repo + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + steps: + - name: Checkout sonic-build + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Update + run: | + git config --global user.name '[github actions]' + git config --global user.email 'bradh352@users.noreply.github.com' + git pull + git remote add upstream https://github.com/sonic-net/sonic-sairedis.git + git fetch upstream + if ! git rebase upstream/master ; then + while ! git rebase --skip ; do + echo "Skipped Commit" + done + fi + git add . + if git status | grep "nothing to commit" > /dev/null ; then + echo "nothing to commit" + else + git commit -am "update sonic-swss and sonic-sairedis branches" + fi + git push --force