Sync fork #7001
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
# This is a basic workflow to help you get started with Actions | |
name: Sync fork | |
on: | |
schedule: | |
- cron: '0 */4 * * *' | |
# scheduled every 4 hours | |
workflow_dispatch: # click the button on Github repo! | |
jobs: | |
sync_latest_from_upstream: | |
runs-on: ubuntu-latest | |
name: Sync latest commits from upstream repo | |
steps: | |
- name: Checkout target repo | |
uses: actions/checkout@v2 | |
with: | |
repository: julyworlds/openwrt-cudy-x6 | |
persist-credentials: false | |
ref: master | |
- name: Sync upstream changes | |
run: | | |
git config --global user.name 'Github actions' | |
git config --global user.email '' | |
# "git checkout master" is unnecessary, already here by default | |
git pull --unshallow # this option is very important, you would get | |
# complains about unrelated histories without it. | |
# (but actions/checkout@v2 can also be instructed | |
# to fetch all git depth right from the start) | |
git remote add upstream https://github.com/openwrt/openwrt.git | |
git fetch upstream | |
git merge --no-edit upstream/master | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
repository: julyworlds/openwrt-cudy-x6 | |
github_token: ${{ secrets.PUSH_TOKEN }} | |
branch: master |