Skip to content

Commit 0ee2287

Browse files
committed
fix: fail missing scope
Fixes #228
1 parent c3bd8ee commit 0ee2287

File tree

8 files changed

+16
-36
lines changed

8 files changed

+16
-36
lines changed

.github/dependabot.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/hooks/pre-commit

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,18 @@ on:
33
pull_request:
44
branches:
55
- main
6-
push:
7-
branches:
8-
- main
96
jobs:
10-
build-lint:
11-
name: Build and lint
7+
build_test_lint:
8+
name: Build, test, and lint
129
runs-on: ubuntu-latest
1310
steps:
1411
- name: Checkout repository
15-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1613
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: "16"
20-
- name: Setup build cache
21-
uses: actions/cache@v3
14+
uses: actions/setup-node@v4
2215
with:
23-
path: '**/node_modules'
24-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25-
restore-keys: ${{ runner.os }}-node-
16+
node-version-file: package.json
2617
- name: Install dependencies
2718
run: npm ci
28-
- name: Compile TypeScript
29-
run: npm run compile
30-
- name: Run linter
31-
run: npm run lint
19+
- name: Test
20+
run: npm run test

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
jobs:
7-
build-tag-release:
7+
build_tag_release:
88
name: Build, tag, and release
99
runs-on: ubuntu-latest
1010
steps:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"typescript": "^5.7.2"
3838
},
3939
"volta": {
40-
"node": "20.18.1"
40+
"node": "20.18.3"
4141
}
4242
}

src/__tests__/lint.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ describe('lintPullRequest tests', () => {
3434
{args: 'feats: test', expected: false},
3535
{args: '(feat): test', expected: false},
3636
{args: 'test', expected: false},
37+
{args: 'feat(): test', expected: false},
38+
{args: 'feat:', expected: false},
39+
{args: 'feat():', expected: false},
40+
{args: 'feat(test):', expected: false},
3741
];
3842

3943
tests.forEach(({args, expected}) => {

src/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function getConventionalCommitTypes(): string {
2727

2828
export async function lintPullRequest(title: string) {
2929
const matches = types.map(type => {
30-
return new RegExp(`^${type}(\\(.*\\))?!?:.*$`);
30+
return new RegExp(`^${type}(\\(.+\\))?!?:.*$`);
3131
});
3232

3333
return matches.some(regex => regex.test(title));

0 commit comments

Comments
 (0)