Skip to content

Commit

Permalink
fix: fail missing scope
Browse files Browse the repository at this point in the history
Fixes #228
  • Loading branch information
jef committed Feb 12, 2025
1 parent c3bd8ee commit 0ee2287
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 36 deletions.
10 changes: 0 additions & 10 deletions .github/dependabot.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/hooks/pre-commit

This file was deleted.

25 changes: 7 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,18 @@ on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build-lint:
name: Build and lint
build_test_lint:
name: Build, test, and lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Setup build cache
uses: actions/cache@v3
uses: actions/setup-node@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
run: npm run compile
- name: Run linter
run: npm run lint
- name: Test
run: npm run test
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
jobs:
build-tag-release:
build_tag_release:
name: Build, tag, and release
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"typescript": "^5.7.2"
},
"volta": {
"node": "20.18.1"
"node": "20.18.3"
}
}
4 changes: 4 additions & 0 deletions src/__tests__/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ describe('lintPullRequest tests', () => {
{args: 'feats: test', expected: false},
{args: '(feat): test', expected: false},
{args: 'test', expected: false},
{args: 'feat(): test', expected: false},
{args: 'feat:', expected: false},
{args: 'feat():', expected: false},
{args: 'feat(test):', expected: false},
];

tests.forEach(({args, expected}) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function getConventionalCommitTypes(): string {

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

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

0 comments on commit 0ee2287

Please sign in to comment.