From c04dc5869d0c38be2404cc63c009f4cf5524873b Mon Sep 17 00:00:00 2001 From: aleksana Date: Fri, 9 Jan 2026 16:40:09 +0800 Subject: [PATCH] workflows/lint: require to contain a colon with a whitespace This restricts github automatically merging master with commit message "Merge branch 'NixOS:master' into ...". Although we don't explicitly prohibit not space after colons, we don't use it in any of the examples. It's also enforced in https://www.conventionalcommits.org/en/v1.0.0/ --- ci/github-script/lint-commits.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/github-script/lint-commits.js b/ci/github-script/lint-commits.js index 4905517a142e..5237b41845e1 100644 --- a/ci/github-script/lint-commits.js +++ b/ci/github-script/lint-commits.js @@ -55,10 +55,11 @@ async function checkCommitMessages({ github, context, core }) { const logMsgStart = `Commit ${commit.sha}'s message's subject ("${firstLine}")` - if (!firstLine.includes(':')) { + if (!firstLine.includes(': ')) { core.error( `${logMsgStart} was detected as not meeting our guidelines because ` + - 'it does not contain a colon. There are likely other issues as well.', + 'it does not contain a colon followed by a whitespace.' + + 'There are likely other issues as well.', ) failures.add(commit.sha) }