-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.01 KB
/
merge-upstream.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
34
35
36
37
name: Sync with upstream
on:
schedule:
- cron: "30 22 * * *"
workflow_dispatch:
jobs:
merge-upstream:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup git
run: |
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global pull.rebase false
- name: Merge changes from main
run: |
git pull https://github.com/KillianLucas/open-interpreter main --no-edit
- name: Compare changes
id: compare
run: |
git diff --name-only HEAD origin/main
echo "changes=$(git diff --name-only HEAD origin/main | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
- name: Push all changes
if: ${{ steps.compare.outputs.changes != '' }}
run: |
git push origin main