Skip to content

Commit 29cc343

Browse files
committed
šŸ› remove undici-pulling import so PR-title check runs without yarn install
The lint workflow runs node directly without `yarn install` to keep it fast. Importing helpers from `executionUtils.ts` pulled `undici` in transitively, which failed at module resolution time on CI. Switch to plain console + exit.
1 parent 8d7317d commit 29cc343

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

ā€Žscripts/check-pr-title.tsā€Ž

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { printError, printLog, runMain } from './lib/executionUtils.ts'
21
import { GITMOJI, normalizeGitmoji } from './lib/gitmoji.ts'
32

43
export function isValidPrTitle(title: string): boolean {
@@ -11,23 +10,21 @@ export function formatAllowedPrefixes(): string {
1110
}
1211

1312
if (import.meta.main) {
14-
runMain(() => {
15-
const title = process.env.PR_TITLE
16-
if (title === undefined) {
17-
throw new Error('PR_TITLE environment variable is not set.')
18-
}
19-
20-
if (isValidPrTitle(title)) {
21-
printLog(`PR title OK: ${title}`)
22-
return
23-
}
13+
const title = process.env.PR_TITLE
14+
if (title === undefined) {
15+
console.error('PR_TITLE environment variable is not set.')
16+
process.exit(1)
17+
}
2418

25-
printError(
19+
if (isValidPrTitle(title)) {
20+
console.log(`PR title OK: ${title}`)
21+
} else {
22+
console.error(
2623
`PR title must start with one of the allowed gitmoji prefixes.\n\n` +
2724
`Current title: ${title}\n\n` +
2825
`Allowed prefixes:\n${formatAllowedPrefixes()}\n\n` +
2926
`See docs/DEVELOPMENT.md for the full convention.`
3027
)
3128
process.exit(1)
32-
})
29+
}
3330
}

0 commit comments

Comments
Ā (0)