@@ -70,20 +70,23 @@ jobs:
7070 }
7171
7272 // Step 1: Check title format
73- const validPrefixes = ['feat:', 'fix:', 'docs:', 'chore:', 'refactor:', 'test:'];
74- const hasValidTitle = validPrefixes.some(prefix => title.startsWith(prefix));
73+ // Matches: feat:, feat(scope):, feat (scope):, etc.
74+ const titlePattern = /^(feat|fix|docs|chore|refactor|test)\s*(\([a-zA-Z0-9-]+\))?\s*:/;
75+ const hasValidTitle = titlePattern.test(title);
7576
7677 if (!hasValidTitle) {
7778 await addLabel('needs:title');
7879 await comment('title', `Hey! Your PR title \`${title}\` doesn't follow conventional commit format.
7980
8081 Please update it to start with one of:
81- - \`feat:\` new feature
82- - \`fix:\` bug fix
83- - \`docs:\` documentation changes
84- - \`chore:\` maintenance tasks
85- - \`refactor:\` code refactoring
86- - \`test:\` adding or updating tests
82+ - \`feat:\` or \`feat(scope):\` new feature
83+ - \`fix:\` or \`fix(scope):\` bug fix
84+ - \`docs:\` or \`docs(scope):\` documentation changes
85+ - \`chore:\` or \`chore(scope):\` maintenance tasks
86+ - \`refactor:\` or \`refactor(scope):\` code refactoring
87+ - \`test:\` or \`test(scope):\` adding or updating tests
88+
89+ Where \`scope\` is the package name (e.g., \`app\`, \`desktop\`, \`opencode\`).
8790
8891 See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#pr-titles) for details.`);
8992 return;
9295 await removeLabel('needs:title');
9396
9497 // Step 2: Check for linked issue (skip for docs/refactor PRs)
95- const skipIssueCheck = title.startsWith(' docs:') || title.startsWith(' refactor:' );
98+ const skipIssueCheck = /^( docs| refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title );
9699 if (skipIssueCheck) {
97100 await removeLabel('needs:issue');
98101 console.log('Skipping issue check for docs/refactor PR');
0 commit comments