This commit is contained in:
NianBroken
2024-02-13 14:35:14 +08:00 Unverified
parent bd6b88cba3
commit f997453e5a
+4 -4
View File
@@ -47,11 +47,11 @@ jobs:
git remote add upstream https://github.com/NianBroken/ZFCheckScores.git git remote add upstream https://github.com/NianBroken/ZFCheckScores.git
git fetch upstream main git fetch upstream main
# 创建一个备份目录,并将当前目录中的所有.txt文件复制到备份目录 # 创建一个备份目录,并将当前目录及子目录中的所有.txt文件复制到备份目录,并保持路径
- name: Backup local .txt files - name: Backup local .txt files
run: | run: |
mkdir -p backup mkdir -p backup
cp -r *.txt backup/ || echo "No .txt files to backup" find . -type f -name "*.txt" -exec cp --parents {} backup/ \; || echo "No .txt files to backup"
# 将上游main分支的更改强制推送到当前main分支 # 将上游main分支的更改强制推送到当前main分支
- name: Force push changes from upstream to current main branch - name: Force push changes from upstream to current main branch
@@ -67,10 +67,10 @@ jobs:
echo "3. 点击 Update branch 或 Discard xxx commits"; echo "3. 点击 Update branch 或 Discard xxx commits";
done; exit 1) done; exit 1)
# 从备份目录将.txt文件还原到当前目录,然后删除备份目录 # 从备份目录将.txt文件还原到当前目录及子目录中,然后删除备份目录
- name: Restore local .txt files and delete backup - name: Restore local .txt files and delete backup
run: | run: |
cp -r backup/*.txt . || echo "No .txt files to restore" find backup -type f -name "*.txt" -exec cp --parents {} . \; || echo "No .txt files to restore"
rm -rf backup rm -rf backup
# 运行主程序main.py # 运行主程序main.py