-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 999 Bytes
/
pre_commit_hooks.yaml
File metadata and controls
33 lines (28 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: "Run pre-commit hooks"
on:
pull_request:
branches:
- "main" # Only for pull requests targeting the main branch
push:
branches:
- "main" # Also trigger on direct pushes to the main branch (e.g. merge)
jobs:
pre-commit:
name: Lint code and README files
runs-on: ubuntu-latest
steps:
# Checkout the branch
- name: Checkout
uses: actions/checkout@v3
# Configure the workflow's environment
- name: Install pre-commit hooks
run: |
# Install pre-commit framework
pip install pre-commit
# Install command Line Interface for MarkdownLint as required for markdownlint hook
npm install -g markdownlint-cli
# Install all hooks defined in the '.pre-commit-config.yaml' file
pre-commit install
# Run all hooks defined in the ".pre-commit-config.yaml" file
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure