fix: 删除自动同步源库工作流,交还主动权给用户自主决策

This commit is contained in:
nap0o committed 2026-03-17 15:18:46 +08:00
1 parent e9a2060ca1
commit 1b809cfc24
2 files changed
+1 -45

No files matched your search

-44
View File
@@ -1,44 +0,0 @@
name: Sync upstream
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Sync main from upstream (Surgical)
run: |
git remote add upstream https://github.com/nap0o/2fauth-worker.git || true
git fetch upstream
git checkout main
if ! git merge upstream/main --no-edit --no-commit; then
git checkout --ours .github/workflows
git add .github/workflows
git commit -m "chore: sync upstream (handled conflicts)"
else
if git diff --name-only HEAD | grep -q ".github/workflows"; then
git checkout HEAD -- .github/workflows
fi
git commit -m "chore: sync upstream (code and assets only)" || echo "no changes"
fi
- name: Push synced main
run: |
git push origin main