## Summary Update the fork sync workflow actions to versions that support Node.js 24. ## Changes - Update `actions/checkout` from `v4` to `v5` - Update `aormsby/Fork-Sync-With-Upstream-action` from `v3.4` to `v3.4.3` ## Reason GitHub Actions now reports the following deprecation warning: > Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24. `actions/checkout@v5` uses the Node.js 24 runtime, and `Fork-Sync-With-Upstream-action@v3.4.2+` has also been updated for Node.js 24.
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: Fork Sync
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *" # 每天午夜执行
|
|
workflow_dispatch: # 允许手动触发
|
|
|
|
jobs:
|
|
sync_with_upstream:
|
|
name: Sync with Upstream
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.repository.fork }}
|
|
|
|
steps:
|
|
- name: Checkout target repo
|
|
uses: actions/checkout@v5
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Sync Upstream
|
|
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.3
|
|
with:
|
|
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
upstream_sync_repo: huangxd-/danmu_api
|
|
upstream_sync_branch: main
|
|
target_sync_branch: main
|
|
test_mode: false
|
|
|
|
- name: Check for new commits
|
|
if: success()
|
|
run: echo "Sync completed successfully"
|
|
|
|
- name: Check for Failure
|
|
if: failure()
|
|
run: |
|
|
echo "[Error] Sync failed. This might be due to:"
|
|
echo "1. Changes in the upstream workflow file"
|
|
echo "2. Merge conflicts that need manual resolution"
|
|
echo "3. Network issues"
|
|
echo "Please check the logs and consider manual sync if needed."
|
|
exit 1
|