Skip to content

fix: remove trailing newline in commit types#43

Merged
G36maid merged 1 commit into
mainfrom
fix/test-prefix-issue
Feb 22, 2026
Merged

fix: remove trailing newline in commit types#43
G36maid merged 1 commit into
mainfrom
fix/test-prefix-issue

Conversation

@G36maid

@G36maid G36maid commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

目的

修復因 YAML 解析行為導致合法的 Commit 訊息(如 test:)被 CI 誤判為無效前綴的問題。

方法/實作說明

YAML 的 > 區塊純量(Block scalar)運算子預設會保留結尾的換行符號,導致傳入腳本的 types 變數結尾變成 test\n。這直接破壞了 check-commit-messages.sh 內的正則表達式 ^($TYPES),使得最後一個型別無法被正確匹配。

  • 主要修改:
    • .github/actions/basic-checks/action.yml
  • 關鍵實作:
    • types input 的預設值從 > 區塊純量改為單行字串,消除隱藏的結尾換行符號。

關聯 Issue

The YAML `>` block scalar operator preserves the trailing newline,
which caused the default `types` input to end with `test\n`.
This broke the regex matching `^($TYPES)` in `check-commit-messages.sh`
and caused valid commit types to be rejected.
@G36maid G36maid added this pull request to the merge queue Feb 22, 2026
Merged via the queue into main with commit 5b1bc09 Feb 22, 2026
6 checks passed
@G36maid G36maid deleted the fix/test-prefix-issue branch February 22, 2026 09:11
@github-actions

Copy link
Copy Markdown

🛡️ PR Quality Check Summary

PR Title: Passed (Length: 44/75, Format: OK). fix: remove trailing newline in commit types
Branch Name: Follows naming convention (fix/test-prefix-issue)
Commit Messages: All 1 commit(s) passed (Length, Format, Case)
Conflicts: No merge conflict markers found
YAML Files: All 12 file(s) passed validation
JSON Files: All 1 file(s) are valid
TOML Files: No TOML files found to check


🎉 All checks passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant