-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
iplcdn
authored
Jan 4, 2021
1 parent
d76d57d
commit 9569836
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#================================================= | ||
# This is free software, lisence use MIT. | ||
# | ||
# Copyright (C) 2020 tbaldwin1 <tbaldwin1@avc.edu> | ||
# | ||
# Description: Build OpenWrt using GitHub Actions | ||
# Lisence: MIT | ||
# Author: iplcdn | ||
# Github: https://github.com/iplcdn | ||
#================================================= | ||
|
||
|
||
name: auto_merge | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 30 14 * * fri | ||
# 示例: 每天晚上22点30执行 '30 14 * * *' | ||
#- cron: 0 7 * * fri | ||
# cron表达式,每周五16点执行一次,actions任务时区为UTC时区。 | ||
# cron表达式,Actions时区是UTC时间,所以上午9点要往前推8个小时 | ||
# cron表达式,Actions时区是UTC时间,所以下午18点要往前推8个小时。 | ||
# 示例: 每天晚上22点30执行 '30 14 * * *' | ||
|
||
|
||
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]" | ||
- name: Load upstream commits | ||
run: | | ||
# git update-index --assume-unchanged ./src/main/resources/config.json | ||
git pull https://github.com/t00t00-crypto/wyy-action.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 | ||
TZ: Asia/Shanghai | ||
run: git push origin $DOWNSTREAM_BRANCH |