summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/pr-standards.yml21
-rw-r--r--CONTRIBUTING.md8
2 files changed, 20 insertions, 9 deletions
diff --git a/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml
index 8e569e5bc..c1cf17567 100644
--- a/.github/workflows/pr-standards.yml
+++ b/.github/workflows/pr-standards.yml
@@ -70,20 +70,23 @@ jobs:
}
// Step 1: Check title format
- const validPrefixes = ['feat:', 'fix:', 'docs:', 'chore:', 'refactor:', 'test:'];
- const hasValidTitle = validPrefixes.some(prefix => title.startsWith(prefix));
+ // Matches: feat:, feat(scope):, feat (scope):, etc.
+ const titlePattern = /^(feat|fix|docs|chore|refactor|test)\s*(\([a-zA-Z0-9-]+\))?\s*:/;
+ const hasValidTitle = titlePattern.test(title);
if (!hasValidTitle) {
await addLabel('needs:title');
await comment('title', `Hey! Your PR title \`${title}\` doesn't follow conventional commit format.
Please update it to start with one of:
- - \`feat:\` new feature
- - \`fix:\` bug fix
- - \`docs:\` documentation changes
- - \`chore:\` maintenance tasks
- - \`refactor:\` code refactoring
- - \`test:\` adding or updating tests
+ - \`feat:\` or \`feat(scope):\` new feature
+ - \`fix:\` or \`fix(scope):\` bug fix
+ - \`docs:\` or \`docs(scope):\` documentation changes
+ - \`chore:\` or \`chore(scope):\` maintenance tasks
+ - \`refactor:\` or \`refactor(scope):\` code refactoring
+ - \`test:\` or \`test(scope):\` adding or updating tests
+
+ Where \`scope\` is the package name (e.g., \`app\`, \`desktop\`, \`opencode\`).
See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#pr-titles) for details.`);
return;
@@ -92,7 +95,7 @@ jobs:
await removeLabel('needs:title');
// Step 2: Check for linked issue (skip for docs/refactor PRs)
- const skipIssueCheck = title.startsWith('docs:') || title.startsWith('refactor:');
+ const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
if (skipIssueCheck) {
await removeLabel('needs:issue');
console.log('Skipping issue check for docs/refactor PR');
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 075d9d351..0385f042a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -192,11 +192,19 @@ PR titles should follow conventional commit standards:
- `refactor:` code refactoring without changing behavior
- `test:` adding or updating tests
+You can optionally include a scope to indicate which package is affected:
+
+- `feat(app):` feature in the app package
+- `fix(desktop):` bug fix in the desktop package
+- `chore(opencode):` maintenance in the opencode package
+
Examples:
- `docs: update contributing guidelines`
- `fix: resolve crash on startup`
- `feat: add dark mode support`
+- `feat(app): add dark mode support`
+- `fix(desktop): resolve crash on startup`
- `chore: bump dependency versions`
### Style Preferences