Skip to content

Merge-upstream

Merge-upstream #94

#
# This is free software, lisence use MIT.
#
# Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
#
# <https://github.com/KFERMercer/OpenWrt-CI>
#
name: Merge-upstream
on:
workflow_dispatch:
schedule:
- cron: 15 20 * * 5
# push:
# branches:
# - main
jobs:
merge:
# runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
# uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
lfs: true
- name: Set git config
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
git config --global --list
- name: Load upstream commits
run: git pull https://github.com/coolsnowwolf/lede.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 origin $DOWNSTREAM_BRANCH