forked from abo-abo/swiper
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 996 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
31
32
33
name: Sync with upstream
on:
schedule:
- cron: "0 0 */7 * *"
workflow_dispatch:
# push:
# branches:
# - feature/native-comp
jobs:
sync:
name: Sync with upstream
runs-on: ubuntu-latest
env:
upstream_repo: abo-abo/swiper
upstream_branch: master
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 20
# token: ${{ secrets.PAT }} # needed for trigger other workflow
# token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup upstream branch
run: |
git remote add upstream https://github.com/$upstream_repo.git
git fetch upstream $upstream_branch --depth=400
- name: Sync
run: |
git config --global user.email "github-actions[bot]"
git config --global user.name "github-actions[bot]@users.noreply.github.com"
git rebase --autosquash --autostash upstream/$upstream_branch
git push origin -f