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

Merge pull request #195 from wagoid/fix/default-to-cjs-extension

fix: default to .cjs extension in config files
This commit is contained in:
Wagner Santos 2021-07-15 15:54:25 -03:00 committed by GitHub
commit 41bc97535b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View file

@ -1,5 +1,5 @@
node_modules
commitlint.config.js
commitlint.config.cjs
action.yml
.github
CHANGELOG.md

View file

@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. See [standa
* Node.js version used on the action updated from 12 to
16
* Config files now need to be renamed from .js to .cjs
### Features

View file

@ -32,7 +32,7 @@ You can supply these inputs to the `wagoid/commitlint-github-action@v3` step.
The path to your commitlint config file.
Default: `commitlint.config.js`
Default: `commitlint.config.cjs`
If the config file doesn't exist, [config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) settings will be loaded as a default fallback.

View file

@ -3,19 +3,20 @@ description: Lints Pull Request commit messages with commitlint
author: Wagner Santos
inputs:
configFile:
description: Commitlint config file. If the file doesn't exist, config-conventional settings will be
description:
Commitlint config file. If the file doesn't exist, config-conventional settings will be
loaded as a fallback.
default: ./commitlint.config.js
default: ./commitlint.config.cjs
required: false
firstParent:
description: >
When set to true, we follow only the first parent commit when seeing a merge commit. More info
in git-log docs https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent
default: "true"
default: 'true'
required: false
failOnWarnings:
description: Whether you want to fail on warnings or not
default: "false"
default: 'false'
required: false
helpURL:
description: Link to a page explaining your commit message convention

View file

@ -48,7 +48,7 @@ describe('Commit Linter action', () => {
td.replace(core, 'getInput')
td.replace(core, 'setFailed')
td.replace(core, 'setOutput')
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js')
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.cjs')
td.when(core.getInput('firstParent')).thenReturn('true')
td.when(core.getInput('failOnWarnings')).thenReturn('false')
td.when(core.getInput('helpURL')).thenReturn(
@ -273,7 +273,7 @@ describe('Commit Linter action', () => {
beforeEach(async () => {
cwd = await git.bootstrap('fixtures/conventional')
td.when(core.getInput('configFile')).thenReturn(
'./commitlint.config.js',
'./commitlint.config.cjs',
)
await gitEmptyCommit(cwd, 'message from before push')
await gitEmptyCommit(cwd, firstMessage)
@ -341,7 +341,7 @@ describe('Commit Linter action', () => {
describe('when it fails to fetch commits', () => {
beforeEach(async () => {
cwd = await git.bootstrap('fixtures/conventional')
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js')
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.cjs')
await gitEmptyCommit(cwd, 'commit message')
await createPullRequestEventPayload(cwd)
const [to] = await getCommitHashes(cwd)