Skip to content

Commit 3559d7d

Browse files
committed
fix: do not call require in the config file to allow other file types
1 parent d92577a commit 3559d7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

run.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { existsSync } = require('fs')
1+
const { existsSync, readFileSync } = require('fs')
22
const { resolve } = require('path')
33
const core = require('@actions/core')
44
const github = require('@actions/github')
@@ -31,7 +31,9 @@ const getRangeFromPullRequest = async () => {
3131

3232
const showLintResults = async ([from, to]) => {
3333
const commits = await read({ from, to })
34-
const config = existsSync(configPath) ? await load(require(configPath)) : {}
34+
const config = existsSync(configPath)
35+
? await load({}, { file: configPath })
36+
: {}
3537
const results = await Promise.all(
3638
commits.map(commit => lint(commit, config.rules)),
3739
)

0 commit comments

Comments
 (0)