diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4af0b4e..a431bf8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,18 +74,12 @@ jobs: - name: Backup files run: | mkdir -p Backup - rsync -av --include="*/" --include="*.txt" --include="*.yml" --exclude="*" ./ Backup/ - - - name: Force push changes from upstream to current main branch - run: | - # 将上游main分支的更改强制推送到当前main分支 - git checkout main - git reset --hard upstream/main + find . -type f -name "*.txt" -exec cp --parents {} ./Backup \; + find . -type f -name "*.yml" -exec cp --parents {} ./Backup \; - name: Restore files run: | - rsync -av Backup/ ./ - rm -rf backup + cp -r Backup/* . - name: Force push changes to main branch run: |