Skip to content

Commit

Permalink
Merge pull request #33 from xsc27/23_pre-commit
Browse files Browse the repository at this point in the history
feat(pre-commit): add hook
  • Loading branch information
rhysd authored Aug 18, 2021
2 parents 3d6a61b + d420aaf commit 081cb3c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- id: actionlint
name: Lint GitHub Actions workflow files
description: Runs actionlint to lint GitHub Actions workflow files
language: system
types: ["yaml"]
files: "^.github/workflows/"
entry: actionlint
18 changes: 18 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,23 @@ Note that currently super-linter does not provide a way to pass additional comma
errors by `-ignore` option with super-linter. See [github/super-linter#1853](https://github.com/github/super-linter/pull/1853) or
[github/super-linter#1667](https://github.com/github/super-linter/pull/1667) for more details.

### pre-commit

[pre-commit][] is a framework for managing and maintaining multi-language Git pre-commit hooks.

actionlint is available as a pre-commit hook.

Once the `actionlint` binary is installed locally, add this to your `.pre-commit-config.yaml` in
your repository:
```yaml
---
repos:
- repo: https://github.com/rhysd/actionlint
rev: main
hooks:
- id: actionlint
```

---

[Checks](checks.md) | [Installation](install.md) | [Configuration](config.md) | [Go API](api.md) | [References](reference.md)
Expand All @@ -287,3 +304,4 @@ errors by `-ignore` option with super-linter. See [github/super-linter#1853](htt
[super-linter]: https://github.com/github/super-linter
[actionlint-matcher]: https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
[preinstall-ubuntu]: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
[pre-commit]: https://pre-commit.com

0 comments on commit 081cb3c

Please sign in to comment.