Skip to content

Commit f7a1780

Browse files
author
LiuHao
committed
[REFACTOR] 分离workflow日志清理为独立action
1 parent 9ea6845 commit f7a1780

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.github/workflows/HiFiNi-Auto-CheckIn.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,5 @@ jobs:
3535
mvn -B exec:java \
3636
-Dexec.mainClass=cloud.ohiyou.HifiniApplication \
3737
-Dexec.cleanupDaemonThreads=false
38-
- name: Delete workflow runs
39-
uses: Mattraks/delete-workflow-runs@v2
40-
with:
41-
token: ${{ github.token }}
42-
repository: ${{ github.repository }}
43-
retain_days: 1
44-
keep_minimum_runs: 2
45-
permissions:
46-
actions: write # 允许删除工作流运行记录
38+
permissions:
4739
contents: read # 允许 checkout 代码
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Cleanup Workflow Runs
2+
3+
on:
4+
workflow_dispatch: # 支持手动触发
5+
schedule:
6+
- cron: "0 16 * * 6" # 每周日北京时间 00:00 (UTC 周六 16:00)
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Delete old workflow runs
13+
uses: Mattraks/delete-workflow-runs@v2
14+
with:
15+
token: ${{ github.token }}
16+
repository: ${{ github.repository }}
17+
retain_days: 7
18+
keep_minimum_runs: 2
19+
permissions:
20+
actions: write # 允许删除工作流运行记录

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ fabric.properties
109109
# Android studio 3.1+ serialized cache file
110110
.idea/caches/build_file_checksums.ser
111111

112+
.omc
113+

0 commit comments

Comments
 (0)