forked from searxng/searxng
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.55 KB
/
update-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
46
47
48
49
50
51
52
53
54
55
name: Auto Merge Fork
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
merge:
runs-on: 'self-hosted' # Ran out of hours :P
steps:
- id: checkoutRepo
name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: confGit
name: Configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- id: addUpstream
name: Add upstream remote
run: git remote add upstream https://github.com/searxng/searxng.git
- id: fetchUpstream
name: Fetch upstream changes
run: git fetch upstream
- id: mergeUpstream
name: Merge upstream changes
run: git merge upstream/master || echo "merge_failed=true" >> $GITHUB_OUTPUT
- id: checkConflicts
name: Check for merge conflicts
if: steps.mergeUpstream.outputs.merge_failed == 'true'
# Check if there is ONLY a conflict in the static css, and preceed if so
run: |
! git status | grep "both modified" | grep -v "searx/static/themes/simple/css" && echo "css_conflict=true" >> $GITHUB_OUTPUT
- id: compileTheme
name: Compile CSS theme
if: steps.checkConflicts.outputs.css_conflict == 'true'
run: |
make themes
! grep -r "<<<<<<< HEAD" searx/static/themes/simple/css/
git add searx/static/themes/simple/css/
git commit -m "Compiled static"
- id: pushChanges
name: Push changes
run: git push origin master