Skip to content

Commit c9c3ad1

Browse files
committed
[CI] Add prek audit hooks
1 parent 4414d8c commit c9c3ad1

File tree

3 files changed

+57
-6
lines changed

3 files changed

+57
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://github.com/j178/prek
2+
name: Audit hooks
3+
4+
on: [pull_request]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
pre-commit:
11+
name: 🏃‍♂️‍➡️ prek on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest]
16+
steps:
17+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
- name: Run prek-action
22+
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
23+
with:
24+
install-only: true
25+
- name: Run manual prek hooks
26+
run: prek run --all-files --config .pre-commit-config-audit.yaml

.pre-commit-config-audit.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
default_stages: [pre-commit, pre-push]
2+
minimum_prek_version: "0.2.22"
3+
default_language_version:
4+
python: python3
5+
node: 24.14.0
6+
exclude: |
7+
(?x)^(
8+
\.git/|
9+
_site/|
10+
node_modules/|
11+
package-lock\.json$
12+
)
13+
14+
repos:
15+
- repo: meta
16+
hooks:
17+
- id: identity
18+
name: Run identity
19+
description: Run the identity check
20+
- id: check-hooks-apply
21+
name: run check-hooks-apply
22+
description: check that all the hooks apply to the repository
23+
24+
- repo: local
25+
hooks:
26+
- id: npm-audit
27+
name: run npm-audit
28+
description: Run npm audit
29+
entry: npm audit
30+
language: system
31+
pass_filenames: false

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ repos:
4343
entry: npm run build
4444
language: system
4545
pass_filenames: false
46-
- id: npm-audit
47-
name: run npm-audit
48-
description: Run npm audit
49-
entry: npm audit
50-
language: system
51-
pass_filenames: false
5246

5347
# GO-based
5448
- repo: https://github.com/gitleaks/gitleaks

0 commit comments

Comments
 (0)