Skip to content

Commit e187277

Browse files
authored
fix: fail missing scope (#251)
1 parent c3bd8ee commit e187277

File tree

13 files changed

+64
-64
lines changed

13 files changed

+64
-64
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/pr-lint.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Pull Request Linter
1+
name: Pull Request Title Linter
22
on:
33
pull_request:
44
types:
55
- opened
66
- edited
77
- reopened
8+
- synchronize
89
jobs:
9-
lint-pr:
10+
pr_lint:
1011
name: Lint pull request title
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout repository
14-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1516
- name: Lint pull request title
1617
uses: ./
1718
with:

.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:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ Live examples:
1414
## Usage
1515

1616
```yaml
17-
name: Pull Request Linter
17+
name: Pull Request Title Linter
1818
on:
1919
pull_request:
2020
types:
2121
- opened
2222
- edited
2323
- reopened
24+
- synchronize
2425
jobs:
25-
lint-pr:
26+
pr_lint:
2627
name: Lint pull request title
2728
runs-on: ubuntu-latest
2829
permissions:
@@ -32,6 +33,7 @@ jobs:
3233
uses: jef/conventional-commits-pr-action@v1
3334
with:
3435
token: ${{ secrets.GITHUB_TOKEN }}
36+
3537
```
3638

3739
## Inputs

dist/index.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15741,6 +15741,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253)
1574115741
const { File: UndiciFile } = __nccwpck_require__(3041)
1574215742
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322)
1574315743

15744+
let random
15745+
try {
15746+
const crypto = __nccwpck_require__(7598)
15747+
random = (max) => crypto.randomInt(0, max)
15748+
} catch {
15749+
random = (max) => Math.floor(Math.random(max))
15750+
}
15751+
1574415752
let ReadableStream = globalThis.ReadableStream
1574515753

1574615754
/** @type {globalThis['File']} */
@@ -15826,7 +15834,7 @@ function extractBody (object, keepalive = false) {
1582615834
// Set source to a copy of the bytes held by object.
1582715835
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
1582815836
} else if (util.isFormDataLike(object)) {
15829-
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
15837+
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
1583015838
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
1583115839

1583215840
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -30034,7 +30042,7 @@ function getConventionalCommitTypes() {
3003430042
}
3003530043
async function lintPullRequest(title) {
3003630044
const matches = types.map(type => {
30037-
return new RegExp(`^${type}(\\(.*\\))?!?:.*$`);
30045+
return new RegExp(`^${type}(\\(.+\\))?!?:.+$`);
3003830046
});
3003930047
return matches.some(regex => regex.test(title));
3004030048
}
@@ -30163,6 +30171,14 @@ module.exports = require("net");
3016330171

3016430172
/***/ }),
3016530173

30174+
/***/ 7598:
30175+
/***/ ((module) => {
30176+
30177+
"use strict";
30178+
module.exports = require("node:crypto");
30179+
30180+
/***/ }),
30181+
3016630182
/***/ 8474:
3016730183
/***/ ((module) => {
3016830184

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
/** @type {import('ts-jest').JestConfigWithTsJest} **/
1+
/** @type {import("ts-jest").JestConfigWithTsJest} **/
22
module.exports = {
33
collectCoverage: true,
44
testEnvironment: 'node',
55
transform: {
66
'^.+.tsx?$': ['ts-jest', {}],
77
},
8+
testPathIgnorePatterns: ['<rootDir>/dist/'],
89
};

package-lock.json

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

0 commit comments

Comments
 (0)