Added the ability to delete run logs
This commit is contained in:
@@ -7,16 +7,17 @@ run-name: DeleteOldRuns
|
|||||||
# 指定此工作流的触发器
|
# 指定此工作流的触发器
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 16 * * *' # 每天0点触发工作流(基于北京时间)
|
- cron: "0 16 * * *" # 每天0点触发工作流(基于北京时间)
|
||||||
workflow_dispatch: # 可以手动执行
|
workflow_dispatch: # 可以手动执行
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 检查成绩
|
# 删除运行记录
|
||||||
DeleteOldRuns:
|
DeleteOldRuns_1:
|
||||||
name: DeleteOldRuns
|
name: DeleteOldRuns
|
||||||
|
|
||||||
# 在最新版的Ubuntu系统上运行
|
# 在最新版的Ubuntu系统上运行
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 360
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 使用GitHub Actions提供的动作来检出代码库
|
# 使用GitHub Actions提供的动作来检出代码库
|
||||||
@@ -64,6 +65,8 @@ jobs:
|
|||||||
if [ -n "$GITHUB_TOKEN" ]; then
|
if [ -n "$GITHUB_TOKEN" ]; then
|
||||||
python delete_old_runs.py
|
python delete_old_runs.py
|
||||||
echo "------"
|
echo "------"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 方便通过截图快速定位到用户
|
# 方便通过截图快速定位到用户
|
||||||
@@ -79,4 +82,31 @@ jobs:
|
|||||||
- name: Delete __pycache__ folder
|
- name: Delete __pycache__ folder
|
||||||
run: |
|
run: |
|
||||||
# 删除__pycache__文件夹
|
# 删除__pycache__文件夹
|
||||||
rm -rf __pycache__
|
rm -rf __pycache__
|
||||||
|
|
||||||
|
# 删除运行记录
|
||||||
|
DeleteOldRuns_2:
|
||||||
|
name: DeleteOldRuns
|
||||||
|
needs: DeleteOldRuns_1
|
||||||
|
|
||||||
|
# 在最新版的Ubuntu系统上运行
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 360
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Run main program
|
||||||
|
id: run_main_program
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
|
||||||
|
REPOSITORY_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
run: |
|
||||||
|
# 运行主程序
|
||||||
|
export BEIJING_TIME="$(TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M:%S:%3N')"
|
||||||
|
echo "BEIJING_TIME=$BEIJING_TIME" >> $GITHUB_OUTPUT
|
||||||
|
if [ -n "$GITHUB_TOKEN" ]; then
|
||||||
|
python delete_old_runs.py
|
||||||
|
echo "------"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user