Skip to content

open-turo/action-pre-commit

Repository files navigation

open-turo/action-pre-commit

Description

GitHub Action for running pre-commit hooks against the repository. Conditionally installs tools needed for the Action to be able to perform its duties such as npm, pre-commit, etc.

Release Tests pass/fail License Contributions welcome CI semantic-release: angular Conventional commits Join us!

Usage

Basic usage with default options:

jobs:
  lint:
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: open-turo/action-pre-commit@v2

Overriding defaults:

jobs:
  lint:
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: open-turo/action-pre-commit@v2
        with:
          # Override the config file used by default
          config-file: .commitlintrc.yaml
          # Don't include `@turo/conventional-commit` configuration
          turo-conventional-commit: false
          # Only run pre-commit against changed files, instead of all files
          only-changed: true

Inputs

parameter description required default
config-file The config file to present to commitlint-github-action true .commitlintrc.yaml
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

Runs

This action is a composite action.

Get Help

Please review Issues, post new Issues against this repository as needed.

Contributions

Please see here for guidelines on how to contribute to this project.