Files
shellcheck/README.md
T
2026-11-05 04:44:33 +00:00

27 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# shellcheck
用 shellcheck 檢查 shell 腳本的 Docker action。shellcheck 的版本由 `version` 輸入指定(通常用 Gitea 變數 `TOOL_SHELLCHECK_VERSION`),執行時下載;沒有符合的檔案就略過,也不下載。
```yaml
- uses: https://gitea.jsc.idv.tw/actions/shellcheck@v0.0.1
with:
files: "*.sh scripts/**/*.sh"
severity: warning
version: ${{ vars.TOOL_SHELLCHECK_VERSION }}
```
## 輸入
|名稱|預設|說明|
|---|---|---|
|`files`|`*.sh`|要檢查的檔案,空白分隔,可用萬用字元(支援 `**`)|
|`version`|是||shellcheck 的版本(例如 `v0.10.0`),通常用 Gitea 變數 `TOOL_SHELLCHECK_VERSION`|
|`severity`|`warning`|回報的最低嚴重度:error、warning、info、style|
## 開發與發版
- CI(`ci.yaml`):用 [action-ci](https://gitea.jsc.idv.tw/actions/action-ci) 跑 shellcheck,建置映像檔並實際執行一次。
- CD(`cd.yaml`):「任何分支 → `main`」的 PR 合併時,用 [action-cd](https://gitea.jsc.idv.tw/actions/action-cd) 算下一個版本([next-version](https://gitea.jsc.idv.tw/actions/next-version),只遞增 patch、每位最大 9)並在 PR 來源最新提交上打標籤;只動文件、圖示、測試、`.gitea/`、`go.mod` 時不發版。直接推送 `main` 不發版。
- 呼叫端要把 Gitea 變數 `ACTION_SHELLCHECK_VERSION` 改成新標籤才會採用。
- 圖示:`icon.svg`(儲存庫頭像用 `icon.png`)。