File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : OpenCode Sync Upstream
2+ on :
3+ schedule :
4+ - cron : " 5 * * * *" # 每小时 :05,错开其他流水线
5+ workflow_dispatch :
6+ permissions :
7+ contents : write
8+ jobs :
9+ sync :
10+ runs-on : ubuntu-latest
11+ timeout-minutes : 10
12+ steps :
13+ - uses : actions/checkout@v6
14+ with :
15+ fetch-depth : 0
16+ - name : Merge upstream into main
17+ run : |
18+ set -euo pipefail
19+ git config user.name "yuloop"
20+ git config user.email "yuloop@users.noreply.github.com"
21+ git remote add upstream "https://github.com/anomalyco/opencode.git"
22+ git fetch upstream dev
23+ # 无新提交 → 静默退出(不产生任何 commit)
24+ if git merge-base --is-ancestor upstream/dev HEAD; then
25+ echo "上游无新提交,跳过"
26+ exit 0
27+ fi
28+ # 非 fork、无共享历史:必须 --allow-unrelated-histories
29+ # -X ours:README.md/CHANGELOG.md/.gitignore 等两边都有的根文档冲突时保留汉化仓库版本
30+ # 上游独有文件(packages/、src/ 等源码)作为新增文件正常合入
31+ git merge --no-edit --allow-unrelated-histories -X ours FETCH_HEAD
32+ git push origin main
You can’t perform that action at this time.
0 commit comments