-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 1008 Bytes
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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_PUBLIC_GITHUB_TOKEN }}
- run: |
# Try GHA for now
# git config user.name "GitHub Action"
# git config user.email "[email protected]"
git config --global user.name "depot-bot"
git config --global user.email "[email protected]"
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_PUBLIC_GITHUB_TOKEN: ${{ secrets.BOT_PUBLIC_GITHUB_TOKEN }}