Compare commits
28 Commits
v0.3.3
...
61c9013fe0
| Author | SHA1 | Date | |
|---|---|---|---|
| 61c9013fe0 | |||
| 7730f56c49 | |||
| e706ad7c5a | |||
| ae8127d5c2 | |||
| 9df8b8dcaa | |||
| 4a6a3c159d | |||
| 8cbe2e3e4d | |||
| 075bc62138 | |||
| 4a2c9d6064 | |||
| 17721ae9d0 | |||
| 9929c05469 | |||
| a078f2d984 | |||
| 9068f5e5b6 | |||
| e40a7adad6 | |||
| 214ec5f7bd | |||
| 829c119657 | |||
| 2ac7efe907 | |||
| 74e3e758c9 | |||
| 3e32b71abe | |||
| a8eaa2a293 | |||
| f6925cc5e7 | |||
| 2daf39673a | |||
| f3afba6e49 | |||
| c5b69ac380 | |||
| 963fa24ce0 | |||
| 93402e99ee | |||
| ac72d18016 | |||
| 70cac9e740 |
@@ -28,5 +28,3 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 清理舊版成品
|
- name: 清理舊版成品
|
||||||
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}
|
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}
|
||||||
with:
|
|
||||||
RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
|
||||||
@@ -2,8 +2,6 @@ name: 'CLEANUP OLD RELEASES'
|
|||||||
description: '清理舊版成品'
|
description: '清理舊版成品'
|
||||||
author: 'Jeffery'
|
author: 'Jeffery'
|
||||||
inputs:
|
inputs:
|
||||||
RUNNER_TOKEN:
|
|
||||||
description: 'GitHub Runner Token'
|
|
||||||
KEEP_COUNT:
|
KEEP_COUNT:
|
||||||
description: '保留的版本數量'
|
description: '保留的版本數量'
|
||||||
default: '2'
|
default: '2'
|
||||||
@@ -13,5 +11,5 @@ runs:
|
|||||||
env:
|
env:
|
||||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
RUNNER_TOKEN: ${{ inputs.RUNNER_TOKEN || secrets.RUNNER_TOKEN }}
|
RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
||||||
KEEP_COUNT: ${{ inputs.KEEP_COUNT }}
|
KEEP_COUNT: ${{ inputs.KEEP_COUNT }}
|
||||||
@@ -40,7 +40,7 @@ fi
|
|||||||
|
|
||||||
# 計算成品數量並依照時間排序
|
# 計算成品數量並依照時間排序
|
||||||
RELEASE_JSON=$(echo "$RELEASE_JSON" | jq -e 'sort_by(.created_at) | reverse')
|
RELEASE_JSON=$(echo "$RELEASE_JSON" | jq -e 'sort_by(.created_at) | reverse')
|
||||||
RELEASE_COUNT=$(echo "$RELEASE_JSON" | jq 'length') && echo "RELEASE_COUNT=$RELEASE_COUNT"
|
RELEASE_COUNT=$(echo "$RELEASE_JSON" | jq 'length')
|
||||||
|
|
||||||
# 檢查成品數量是否需要清除
|
# 檢查成品數量是否需要清除
|
||||||
[ $RELEASE_COUNT -le $KEEP_COUNT ] && exit 0
|
[ $RELEASE_COUNT -le $KEEP_COUNT ] && exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user