mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 08:06:54 +00:00
feat: add firstParent input to ignore errors from your default branch
This commit is contained in:
parent
23cd801837
commit
598e473cb4
3 changed files with 16 additions and 0 deletions
|
|
@ -26,6 +26,15 @@ jobs:
|
|||
|
||||
The path to your commitlint config file. Default `commitlint.config.js`.
|
||||
|
||||
### `firstParent`
|
||||
|
||||
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).
|
||||
|
||||
Default `true`
|
||||
|
||||
## 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:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ inputs:
|
|||
configFile:
|
||||
description: 'commitlint config file'
|
||||
default: './commitlint.config.js'
|
||||
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
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'docker://wagoid/commitlint-github-action:1.1.1'
|
||||
|
|
|
|||
4
run.js
4
run.js
|
|
@ -40,6 +40,10 @@ function getHistoryCommits(from, to) {
|
|||
to,
|
||||
}
|
||||
|
||||
if (core.getInput('firstParent') === 'true') {
|
||||
options.firstParent = true
|
||||
}
|
||||
|
||||
if (!from) {
|
||||
options.maxCount = 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue