555ecc1aaf
之前 workflow 在 ci 分支,导致每次 dispatch 后 Gitea Actions 列表 显示的 commit 都是 ci 分支的 workflow 文件 commit,不是被实际构建 的 custom 代码 commit,UX 上误导性强。 挪到 custom 后: - runs 列表的 commit 字段直接显示真实代码 commit - workflow_dispatch UI 自动从默认分支(待手动切到 custom)发现 workflow - rebase 上游时 workflow 文件随 custom 一起平移,无额外操作 同步移除上游残留的 docker-release.yml / docker-snapshot.yml: - 触发依赖 secrets.DOCKER_REPO(未配),sync-upstream 推 main /tags 时空跑失败 - ci 上已禁用,但文件留着是噪声,本次清掉 ci 分支 .gitea/workflows/ 暂保留作过渡,待用户在 Gitea UI 把 默认分支切到 custom + 验证 build 跑通后,再单独 cleanup ci。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Sync from upstream
|
||
|
||
on:
|
||
workflow_dispatch:
|
||
inputs:
|
||
tag:
|
||
description: '要同步的 release tag(留空则同步到 upstream/main 的最新 tag)'
|
||
required: false
|
||
default: ''
|
||
|
||
jobs:
|
||
sync:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
with:
|
||
fetch-depth: 0
|
||
token: ${{ secrets.SYNC_TOKEN }}
|
||
|
||
- name: Sync main to release tag
|
||
run: |
|
||
git config user.name "gitea-actions"
|
||
git config user.email "actions@gitea.local"
|
||
git remote add upstream https://git.zhengchentao.win/mirror/ezbookkeeping.git
|
||
git fetch upstream --tags
|
||
|
||
if [ -n "${{ inputs.tag }}" ]; then
|
||
TARGET="${{ inputs.tag }}"
|
||
else
|
||
TARGET=$(git tag -l --sort=-v:refname | head -n 1)
|
||
fi
|
||
|
||
echo "==> Syncing main to $TARGET"
|
||
git rev-parse "$TARGET" || { echo "❌ Tag $TARGET not found"; exit 1; }
|
||
|
||
git checkout -B main origin/main
|
||
git reset --hard "$TARGET"
|
||
git push origin main --force-with-lease
|
||
git push origin --tags |