logo
0
0
WeChat Login
docs: 同步脚本增加自动提交推送步骤

同步远程仓库

初始化(修改远程仓库以及主分支)

REPO_URL="https://github.com/nix-darwin/nix-darwin.git" BRANCH="master" git remote add upstream $REPO_URL git fetch upstream git checkout $BRANCH git reset --hard upstream/$BRANCH git push origin $BRANCH

同步任务(同一个shell下执行)

mkdir -p .cnb && tee .cnb/web_trigger.yml <<EOF branch: - buttons: - name: Sync description: Sync manually event: web_trigger_sync EOF tee .cnb.yml <<EOF .sync: name: sync with upstream script: - git remote add upstream $REPO_URL - git fetch upstream - git rebase upstream/$BRANCH - git push origin $BRANCH --force $BRANCH: web_trigger_sync: - stages: - !reference [.sync] "crontab: 0 8 * * *": - stages: - !reference [.sync] EOF git add .cnb .cnb.yml git commit -m "build: sync with upstream" git push origin $BRANCH