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
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