| | name: Upstream Sync |
| |
|
| | on: |
| | schedule: |
| | - cron: "0 0 * * *" |
| | workflow_dispatch: |
| |
|
| | jobs: |
| | |
| | check-repository: |
| | name: Check Repository Type |
| | runs-on: ubuntu-latest |
| | outputs: |
| | is_fork: ${{ steps.check.outputs.is_fork }} |
| | steps: |
| | - id: check |
| | run: | |
| | if [ "${{ github.repository }}" != "ErlichLiu/DeepClaude" ]; then |
| | echo "is_fork=true" >> $GITHUB_OUTPUT |
| | else |
| | echo "is_fork=false" >> $GITHUB_OUTPUT |
| | fi |
| | |
| | |
| | sync: |
| | needs: check-repository |
| | if: needs.check-repository.outputs.is_fork == 'true' |
| | name: Sync Latest From Upstream |
| | runs-on: ubuntu-latest |
| | steps: |
| | |
| | - name: Checkout target repo |
| | uses: actions/checkout@v4 |
| | |
| | |
| | |
| | |
| | |
| | - name: Get branch name (merge) |
| | if: github.event_name != 'pull_request' |
| | shell: bash |
| | run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV |
| | |
| | - name: Get branch name (pull request) |
| | if: github.event_name == 'pull_request' |
| | shell: bash |
| | run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV |
| | |
| | |
| | - name: Sync upstream changes |
| | id: sync |
| | uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 |
| | with: |
| | upstream_sync_repo: ErlichLiu/DeepClaude |
| | upstream_sync_branch: ${{ env.BRANCH_NAME }} |
| | target_sync_branch: ${{ env.BRANCH_NAME }} |
| | target_repo_token: ${{ secrets.GITHUB_TOKEN }} |
| | upstream_pull_args: --allow-unrelated-histories --no-edit |
| | shallow_since: '1 days ago' |
| | test_mode: false |