Update main.yml

This commit is contained in:
碎念_Nian
2024-02-02 21:08:56 +08:00
committed by GitHub
Unverified
parent 24bd3ba6bc
commit b064aec5ac
+2 -8
View File
@@ -35,10 +35,7 @@ jobs:
- name: Backup local .txt files # 创建一个备份目录,并将当前目录中的所有.txt文件复制到备份目录 - name: Backup local .txt files # 创建一个备份目录,并将当前目录中的所有.txt文件复制到备份目录
run: | run: |
mkdir backup mkdir backup
if [ -e *.txt ]; then cp *.txt backup/
cp *.txt backup/
fi
shell: /usr/bin/bash -e {0}
- name: Force push changes from upstream to current main branch # 将上游main分支的更改强制推送到当前main分支 - name: Force push changes from upstream to current main branch # 将上游main分支的更改强制推送到当前main分支
run: | run: |
@@ -48,11 +45,8 @@ jobs:
- name: Restore local .txt files and delete backup # 从备份目录将.txt文件还原到当前目录,然后删除备份目录 - name: Restore local .txt files and delete backup # 从备份目录将.txt文件还原到当前目录,然后删除备份目录
run: | run: |
if [ -e backup/*.txt ]; then cp backup/*.txt .
cp backup/*.txt .
fi
rm -rf backup rm -rf backup
shell: /usr/bin/bash -e {0}
- name: Run main.py # 运行主程序main.py - name: Run main.py # 运行主程序main.py
run: python main.py run: python main.py