-
Notifications
You must be signed in to change notification settings - Fork 11
45 lines (38 loc) · 1.34 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
38
39
40
41
42
43
44
45
name: Sync with upstream
on:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:
jobs:
merge-upstream:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Setup git
run: |
git config --global user.email ${{ github.repository_owner_id }}+${{ github.repository_owner }}@users.noreply.github.com
git config --global user.name ${{ github.repository_owner }}
git config --global pull.rebase false
- name: Merge changes from main
run: |
git pull https://github.com/tachiyomiorg/tachiyomi-extensions master --no-edit -X theirs
- 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
- name: Trigger build
uses: peter-evans/[email protected]
if: ${{ steps.compare.outputs.changes != '' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: build