refactor: uppercase action inputs
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
Action 會依序嘗試以下來源:
|
Action 會依序嘗試以下來源:
|
||||||
|
|
||||||
1. `inputs.runner_token`
|
1. `inputs.RUNNER_TOKEN`
|
||||||
2. `secrets.GITEA_TOKEN`
|
2. `secrets.GITEA_TOKEN`
|
||||||
3. `secrets.RUNNER_TOKEN`
|
3. `secrets.RUNNER_TOKEN`
|
||||||
|
|
||||||
@@ -23,9 +23,9 @@ Action 會依序嘗試以下來源:
|
|||||||
|
|
||||||
| 名稱 | 類型 | 預設值 | 說明 |
|
| 名稱 | 類型 | 預設值 | 說明 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `runner_token` | string | - | Gitea API token,優先順序最高 |
|
| `RUNNER_TOKEN` | string | - | Gitea API token,優先順序最高 |
|
||||||
| `keep_versions` | integer string | `2` | 每個套件要保留的最新版本數,必須是整數且 `>= 0` |
|
| `KEEP_VERSIONS` | integer string | `2` | 每個套件要保留的最新版本數,必須是整數且 `>= 0` |
|
||||||
| `dry_run` | boolean string | `true` | `true` 只列出候選,`false` 才會呼叫 DELETE API |
|
| `DRY_RUN` | boolean string | `true` | `true` 只列出候選,`false` 才會呼叫 DELETE API |
|
||||||
|
|
||||||
## Log 行為
|
## Log 行為
|
||||||
|
|
||||||
@@ -48,13 +48,13 @@ Action 會依序嘗試以下來源:
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
cleanup:
|
cleanup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu
|
||||||
steps:
|
steps:
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
runner_token: ${{ secrets.GITEA_TOKEN }}
|
RUNNER_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
keep_versions: 2
|
KEEP_VERSIONS: 2
|
||||||
dry_run: true
|
DRY_RUN: true
|
||||||
```
|
```
|
||||||
|
|
||||||
### 實際刪除
|
### 實際刪除
|
||||||
@@ -62,13 +62,13 @@ jobs:
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
cleanup:
|
cleanup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu
|
||||||
steps:
|
steps:
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
runner_token: ${{ secrets.GITEA_TOKEN }}
|
RUNNER_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
keep_versions: 2
|
KEEP_VERSIONS: 2
|
||||||
dry_run: false
|
DRY_RUN: false
|
||||||
```
|
```
|
||||||
|
|
||||||
## 測試
|
## 測試
|
||||||
|
|||||||
+4
-4
@@ -2,14 +2,14 @@ name: 'CLEANUP OLD NUGET'
|
|||||||
description: '清理 Nuget 沒用到的資源'
|
description: '清理 Nuget 沒用到的資源'
|
||||||
author: 'Jeffery'
|
author: 'Jeffery'
|
||||||
inputs:
|
inputs:
|
||||||
runner_token:
|
RUNNER_TOKEN:
|
||||||
description: 'Gitea API token, highest priority source'
|
description: 'Gitea API token, highest priority source'
|
||||||
required: false
|
required: false
|
||||||
keep_versions:
|
KEEP_VERSIONS:
|
||||||
description: 'Number of recent package versions to keep'
|
description: 'Number of recent package versions to keep'
|
||||||
required: false
|
required: false
|
||||||
default: '2'
|
default: '2'
|
||||||
dry_run:
|
DRY_RUN:
|
||||||
description: 'When true, only print delete candidates'
|
description: 'When true, only print delete candidates'
|
||||||
required: false
|
required: false
|
||||||
default: 'true'
|
default: 'true'
|
||||||
@@ -19,4 +19,4 @@ 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.GITEA_TOKEN || secrets.RUNNER_TOKEN }}
|
RUNNER_TOKEN: ${{ inputs.RUNNER_TOKEN || secrets.GITEA_TOKEN || secrets.RUNNER_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user