Auto Merge Fork #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Merge Fork | |
on: | |
schedule: | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
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 |