From 4f5ee7670d3cdb94090ed9310b4fe91828af2fa1 Mon Sep 17 00:00:00 2001 From: roothider <158083651+roothider@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:49:52 +0800 Subject: [PATCH] Update sync.yml --- .github/workflows/sync.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 1c5dd77b6..fa90fc4c0 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -14,23 +14,30 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: true + submodules: recursive - name: Merge upstream changes + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | + set -e + set -x + git config --global user.name "$GITHUB_ACTOR" git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" + git remote add upstream https://github.com/theos/theos.git + git checkout master && git fetch upstream && git merge upstream/master + + cd vendor/lib + git remote add upstream https://github.com/theos/lib.git git checkout master && git fetch upstream && git merge upstream/master && git push - git submodule update --remote vendor/lib - git submodule update --remote vendor/include - git commit --all -m "[submodules] Update submodules to the latest commit" && git push || echo "No changes to submodules" - curl --fail -X PUT \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ - https://api.github.com/repos/roothide/lib/actions/workflows/sync.yml/enable - curl --fail -X PUT \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ - https://api.github.com/repos/roothide/headers/actions/workflows/sync.yml/enable + cd - + + cd vendor/include + git remote add upstream https://github.com/theos/headers.git + git checkout master && git fetch upstream && git merge upstream/master && git push + cd - + + git commit --all -m "Sync Repo" && git push || echo "No changes" \ No newline at end of file