diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..2da5fac --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,30 @@ +name: Sync +on: + workflow_dispatch: {} + schedule: + - cron: "*/10 * * * *" + +jobs: + sync: + name: Sync With Upstream + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.BOT_GITHUB_TOKEN }} + - run: | + # Try GHA for now + # git config user.name "GitHub Action" + # git config user.email "action@github.com" + + git config --global user.name "depot-bot" + git config --global user.email "71396760+depot-bot@users.noreply.github.com" + git submodule init + git submodule update --remote --merge + export UPSTREAM="$(cd upstream && git remote get-url origin)" + export COMMIT_SHA="$(cd upstream && git rev-parse HEAD)" + git commit -am "Update upstream to ${UPSTREAM}/commit/${COMMIT_SHA}" || echo "No changes" + git push origin main + env: + BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}