Skip to content

Commit 41bc975

Browse files
authored
Merge pull request #195 from wagoid/fix/default-to-cjs-extension
fix: default to .cjs extension in config files
2 parents 0dd6697 + 5b6cd1b commit 41bc975

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
commitlint.config.js
2+
commitlint.config.cjs
33
action.yml
44
.github
55
CHANGELOG.md

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. See [standa
1111

1212
* Node.js version used on the action updated from 12 to
1313
16
14+
* Config files now need to be renamed from .js to .cjs
1415

1516
### Features
1617

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can supply these inputs to the `wagoid/commitlint-github-action@v3` step.
3232

3333
The path to your commitlint config file.
3434

35-
Default: `commitlint.config.js`
35+
Default: `commitlint.config.cjs`
3636

3737
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.
3838

action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ description: Lints Pull Request commit messages with commitlint
33
author: Wagner Santos
44
inputs:
55
configFile:
6-
description: Commitlint config file. If the file doesn't exist, config-conventional settings will be
6+
description:
7+
Commitlint config file. If the file doesn't exist, config-conventional settings will be
78
loaded as a fallback.
8-
default: ./commitlint.config.js
9+
default: ./commitlint.config.cjs
910
required: false
1011
firstParent:
1112
description: >
1213
When set to true, we follow only the first parent commit when seeing a merge commit. More info
1314
in git-log docs https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent
14-
default: "true"
15+
default: 'true'
1516
required: false
1617
failOnWarnings:
1718
description: Whether you want to fail on warnings or not
18-
default: "false"
19+
default: 'false'
1920
required: false
2021
helpURL:
2122
description: Link to a page explaining your commit message convention

src/action.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('Commit Linter action', () => {
4848
td.replace(core, 'getInput')
4949
td.replace(core, 'setFailed')
5050
td.replace(core, 'setOutput')
51-
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js')
51+
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.cjs')
5252
td.when(core.getInput('firstParent')).thenReturn('true')
5353
td.when(core.getInput('failOnWarnings')).thenReturn('false')
5454
td.when(core.getInput('helpURL')).thenReturn(
@@ -273,7 +273,7 @@ describe('Commit Linter action', () => {
273273
beforeEach(async () => {
274274
cwd = await git.bootstrap('fixtures/conventional')
275275
td.when(core.getInput('configFile')).thenReturn(
276-
'./commitlint.config.js',
276+
'./commitlint.config.cjs',
277277
)
278278
await gitEmptyCommit(cwd, 'message from before push')
279279
await gitEmptyCommit(cwd, firstMessage)
@@ -341,7 +341,7 @@ describe('Commit Linter action', () => {
341341
describe('when it fails to fetch commits', () => {
342342
beforeEach(async () => {
343343
cwd = await git.bootstrap('fixtures/conventional')
344-
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js')
344+
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.cjs')
345345
await gitEmptyCommit(cwd, 'commit message')
346346
await createPullRequestEventPayload(cwd)
347347
const [to] = await getCommitHashes(cwd)

0 commit comments

Comments
 (0)