Skip to content

Merge-upstream

Merge-upstream #1486

#
# This is free software, lisence use MIT.
#
# Copyright (C) 2020 KFERMercer <[email protected]>
#
# <https://github.com/KFERMercer/OpenWrt-CI>
#
name: Merge-upstream
on:
workflow_dispatch:
schedule:
- cron: 50 23 * * *
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
lfs: true
- name: Set git identity
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config --global pull.rebase false
- name: Load upstream commits
run: git pull https://github.com/v2fly/domain-list-community.git --log --no-commit
- name: Apply commit changes
run: |
if [ -f ./.git/MERGE_MSG ]; then
mkdir ./tmp && cp ./.git/MERGE_MSG ./tmp/message
sed -i "1c [bot] AutoMerging: merge all upstream's changes:" ./tmp/message
sed -i '/^\#.*/d' ./tmp/message
git commit --file="./tmp/message"
else
echo "There is no merge commits."
fi
- name: Push Commits
env:
DOWNSTREAM_BRANCH: master
run: git push https://YW5vbnltb3Vz:${{ secrets.access_token }}@github.com/${{ github.repository }} $DOWNSTREAM_BRANCH
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 0
keep_minimum_runs: 1