fix: remove trailing newline in commit types#43
Merged
Conversation
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.
🛡️ PR Quality Check Summary✅ PR Title: Passed (Length: 44/75, Format: OK). 🎉 All checks passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
修復因 YAML 解析行為導致合法的 Commit 訊息(如
test:)被 CI 誤判為無效前綴的問題。方法/實作說明
YAML 的
>區塊純量(Block scalar)運算子預設會保留結尾的換行符號,導致傳入腳本的types變數結尾變成test\n。這直接破壞了check-commit-messages.sh內的正則表達式^($TYPES),使得最後一個型別無法被正確匹配。.github/actions/basic-checks/action.ymltypesinput 的預設值從>區塊純量改為單行字串,消除隱藏的結尾換行符號。關聯 Issue
無