From 5f40863856b070367db412c1c7a6f3d8e43249fe Mon Sep 17 00:00:00 2001 From: Victor Mora Date: Mon, 13 Apr 2026 22:31:12 +0000 Subject: [PATCH] feat: add disable-commitlint input to skip commitlint Adds a new optional `disable-commitlint` input (default `"false"`) that allows repos that don't enforce conventional commits to still use action-pre-commit without running commitlint. --- README.md | 1 + action.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 954ca21..3036f2f 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ jobs: | parameter | description | required | default | | --- | --- | --- | --- | | config-file | The config file to present to commitlint-github-action | `true` | .commitlintrc.yaml | +| disable-commitlint | Set this to "true" to disable commitlint entirely | `false` | false | | turo-conventional-commit | Set this to "false" to customize conventional commit configuration | `true` | true | | only-changed | Set this to "true" to only run pre-commit against changed files, and not the entire repository | `false` | | | stage | Set this to run pre-commit against a specific stage of the pre-commit hooks. | `false` | | diff --git a/action.yaml b/action.yaml index 17358cc..14fb0f4 100644 --- a/action.yaml +++ b/action.yaml @@ -5,6 +5,10 @@ inputs: required: true description: The config file to present to commitlint-github-action default: .commitlintrc.yaml + disable-commitlint: + required: false + description: Set this to "true" to disable commitlint entirely + default: "false" turo-conventional-commit: required: true description: Set this to "false" to customize conventional commit configuration @@ -89,6 +93,7 @@ runs: node-version: ${{ steps.node-version.outputs.version }} - name: Commitlint # This version needs to be sync'd with the repo HEAD if a major version is cut + if: inputs.disable-commitlint != 'true' uses: open-turo/action-pre-commit/commitlint@v3 with: restore-config: "false" @@ -152,7 +157,7 @@ runs: PRE_COMMIT_HOME: ${{ runner.temp }}/${{ github.event.repository.name }}/cache-pre-commit-${{ steps.pre_commit_cache_key.outputs.key }} - name: Restore commitlint config - if: always() && hashFiles(inputs.config-file) != '' && inputs.turo-conventional-commit == 'true' + if: always() && inputs.disable-commitlint != 'true' && hashFiles(inputs.config-file) != '' && inputs.turo-conventional-commit == 'true' shell: bash env: CONFIG_FILE: ${{ inputs.config-file }}