https://github.com/open-turo/action-pre-commit
GitHub Action for running pre-commit hooks
https://github.com/open-turo/action-pre-commit
action actions ci gha github lint linting pre-commit tool tooling tools
Last synced: 7 months ago
JSON representation
GitHub Action for running pre-commit hooks
- Host: GitHub
- URL: https://github.com/open-turo/action-pre-commit
- Owner: open-turo
- License: mit
- Created: 2022-02-14T22:35:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-20T00:09:31.000Z (over 1 year ago)
- Last Synced: 2024-05-20T01:26:49.859Z (over 1 year ago)
- Topics: action, actions, ci, gha, github, lint, linting, pre-commit, tool, tooling, tools
- Language: Shell
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 7
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `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.
[](https://github.com/open-turo/action-pre-commit/releases/)
[](https://github.com/open-turo/action-pre-commit/actions/)
[](./LICENSE)
[](https://github.com/dwyl/esta/issues)

[](https://github.com/semantic-release/semantic-release)
[](https://conventionalcommits.org)
[](https://turo.com/jobs)
## Usage
Basic usage with default options:
```yaml
jobs:
lint:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: open-turo/action-pre-commit@v2
```
Overriding defaults:
```yaml
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` | |
| s3-bucket-name | S3 bucket name to cache node_modules to speed up dependency installation. | `false` | |
| s3-bucket-region | S3 bucket region to cache node_modules to speed up dependency installation. | `false` | |
## Outputs
| parameter | description |
| --- | --- |
| cache-hit | Whether the cache was hit when installing dependencies |
## Runs
This action is a `composite` action.
## Get Help
Please review Issues, post new Issues against this repository as needed.
## Contributions
Please see [here](https://github.com/open-turo/contributions) for guidelines on how to contribute to this project.