diff --git a/README.md b/README.md index 195faa4..e7f5b99 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,7 @@ Default: `commitlint.config.js` When set to true, we follow only the first parent commit when seeing a merge commit. -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). +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). Default: `true` @@ -49,6 +48,12 @@ Whether you want to fail on warnings or not. Default: `false` +### `helpURL` + +Link to a page explaining your commit message convention. + +default: `https://github.com/conventional-changelog/commitlint/#what-is-commitlint` + ## About `extends` in your config file 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: diff --git a/action.js b/action.js index ce2f1eb..d8fa98b 100644 --- a/action.js +++ b/action.js @@ -106,8 +106,7 @@ const formatErrors = results => { results }, { color: true, - helpUrl: - 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint', + helpUrl: core.getInput('helpURL'), }, ) diff --git a/action.test.js b/action.test.js index b49caba..e9fceae 100644 --- a/action.test.js +++ b/action.test.js @@ -46,6 +46,9 @@ describe('Commit Linter action', () => { td.when(core.getInput('configFile')).thenReturn('./commitlint.config.js') td.when(core.getInput('firstParent')).thenReturn('true') td.when(core.getInput('failOnWarnings')).thenReturn('false') + td.when(core.getInput('helpURL')).thenReturn( + 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint', + ) }) afterEach(() => { diff --git a/action.yml b/action.yml index 2050a81..58bf46b 100644 --- a/action.yml +++ b/action.yml @@ -3,17 +3,21 @@ description: 'Lints Pull Request commit messages with commitlint' author: 'Wagner Santos' inputs: configFile: - description: 'commitlint config file' + description: 'Commitlint config file' default: './commitlint.config.js' 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' + 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' required: false failOnWarnings: - description: 'whether you want to fail on warnings or not' + description: 'Whether you want to fail on warnings or not' default: 'false' required: false + helpURL: + description: 'Link to a page explaining your commit message convention' + default: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint' + required: false runs: using: 'docker' image: 'docker://wagoid/commitlint-github-action:1.3.2'