5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 16:06:56 +00:00

fix: do not call require in the config file to allow other file types

This commit is contained in:
Wagner Santos 2019-10-08 10:43:49 -03:00
parent d92577a12c
commit 3559d7d304

6
run.js
View file

@ -1,4 +1,4 @@
const { existsSync } = require('fs')
const { existsSync, readFileSync } = require('fs')
const { resolve } = require('path')
const core = require('@actions/core')
const github = require('@actions/github')
@ -31,7 +31,9 @@ const getRangeFromPullRequest = async () => {
const showLintResults = async ([from, to]) => {
const commits = await read({ from, to })
const config = existsSync(configPath) ? await load(require(configPath)) : {}
const config = existsSync(configPath)
? await load({}, { file: configPath })
: {}
const results = await Promise.all(
commits.map(commit => lint(commit, config.rules)),
)