Skip to content

Commit f4821d1

Browse files
committed
feat: add helpURL parameter
1 parent 73133a4 commit f4821d1

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Default: `commitlint.config.js`
3838

3939
When set to true, we follow only the first parent commit when seeing a merge commit.
4040

41-
This helps to ignore errors in commits that were already present in your default branch (e.g. `master`) before adding conventional commit checks.
42-
More info in [git-log docs](https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent).
41+
This helps to ignore errors in commits that were already present in your default branch (e.g. `master`) before adding conventional commit checks. More info in [git-log docs](https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent).
4342

4443
Default: `true`
4544

@@ -49,6 +48,12 @@ Whether you want to fail on warnings or not.
4948

5049
Default: `false`
5150

51+
### `helpURL`
52+
53+
Link to a page explaining your commit message convention.
54+
55+
default: `https://github.com/conventional-changelog/commitlint/#what-is-commitlint`
56+
5257
## About `extends` in your config file
5358

5459
This is a [`Docker` action](https://github.com/actions/toolkit/blob/e2adf403d6d14a9ca7474976ccaca20f72ff8209/docs/action-types.md#why-would-i-choose-a-docker-action), and was made like this so that you can run it with minimum setup, regardless of your repo's environment. It comes packed with the most famous shared configurations that you can use in your commitlint config's `extends` field:

action.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ const formatErrors = results =>
106106
{ results },
107107
{
108108
color: true,
109-
helpUrl:
110-
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
109+
helpUrl: core.getInput('helpURL'),
111110
},
112111
)
113112

action.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ describe('Commit Linter action', () => {
4646
td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js')
4747
td.when(core.getInput('firstParent')).thenReturn('true')
4848
td.when(core.getInput('failOnWarnings')).thenReturn('false')
49+
td.when(core.getInput('helpURL')).thenReturn(
50+
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
51+
)
4952
})
5053

5154
afterEach(() => {

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ description: 'Lints Pull Request commit messages with commitlint'
33
author: 'Wagner Santos'
44
inputs:
55
configFile:
6-
description: 'commitlint config file'
6+
description: 'Commitlint config file'
77
default: './commitlint.config.js'
88
required: false
99
firstParent:
10-
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'
10+
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'
1111
default: 'true'
1212
required: false
1313
failOnWarnings:
14-
description: 'whether you want to fail on warnings or not'
14+
description: 'Whether you want to fail on warnings or not'
1515
default: 'false'
1616
required: false
17+
helpURL:
18+
description: 'Link to a page explaining your commit message convention'
19+
default: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
20+
required: false
1721
runs:
1822
using: 'docker'
1923
image: 'docker://wagoid/commitlint-github-action:1.3.2'

0 commit comments

Comments
 (0)