The upstream aormsby/fork-sync-with-upstream-action v3.4.3 fails when the target branch name collides with a real directory in the repo (branch `main` vs `main/` dir), aborting the daily fork-sync workflow with "ambiguous argument 'main'". Point the pin temporarily at the fork that carries the fix (upstream PR aormsby/Fork-Sync-With-Upstream-action#85) so the sync can run; revert to the official release once it is merged and tagged.
40 lines
1.5 KiB
YAML
40 lines
1.5 KiB
YAML
name: Upstream Sync
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *" # every day
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sync_latest_from_upstream:
|
|
name: Sync latest commits from upstream repo
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.repository.fork }}
|
|
|
|
steps:
|
|
# Step 1: run a standard checkout action
|
|
- name: Checkout target repo
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# Step 2: run the sync action
|
|
- name: Sync upstream changes
|
|
id: sync
|
|
uses: Shinku-Chen/fork-sync-with-upstream-action@66925e8bb37b2590950a72d786b308e4f1b5301f # TEMP: v3.4.3 + fix for `rev-list` ambiguous branch/dir `main` (upstream PR aormsby/Fork-Sync-With-Upstream-action#85); switch back to aormsby release once merged
|
|
with:
|
|
upstream_sync_repo: FoloToy/ai-passport
|
|
upstream_sync_branch: main
|
|
target_sync_branch: main
|
|
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
|
|
|
|
- name: Sync check
|
|
if: failure()
|
|
run: |
|
|
echo "[Error] 由于上游仓库的 workflow 文件变更,GitHub 可能暂停本次自动更新。请手动 Sync Fork,详见 docs/development/CI-sync-main.md。"
|
|
echo "[Error] An upstream workflow change may have paused automatic synchronization. Sync the fork manually; see docs/development/CI-sync-main.md."
|
|
exit 1
|