Skip to content

Commit 0e1131d

Browse files
mdeweerdpgrange
authored andcommitted
Calling bash-unit pre-commit hook in ci + sample setup
1 parent 644c19e commit 0e1131d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ jobs:
3232
run: |
3333
set -o pipefail
3434
pre-commit gc
35+
# Run default pre-commit hooks
3536
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
37+
# Run manual pre-commit hook that runs bash_unit@rev
38+
# defined in .pre-commit-config.yaml
39+
pre-commit run bash-unit --hook-stage manual -a | tee -a ${RAW_LOG}
40+
# Run this version of bash_unit using it's current pre-commit-hook.yaml config
41+
# Useful for testing that the current version works
42+
pre-commit try-repo . --verbose --all-files | tee -a ${RAW_LOG}
3643
- name: Convert Raw Log to annotations
3744
uses: mdeweerd/logToCheckStyle@v2024.2.3
3845
if: ${{ failure() }}

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ repos:
8383
language: system
8484
entry: bash -c "./bash_unit tests/*"
8585
pass_filenames: false
86+
87+
- repo: https://github.com/pgrange/bash_unit
88+
rev: 308c139639269b89c26911098b7739ee2400fcbd
89+
hooks:
90+
- id: bash-unit
91+
stages: [manual]
92+
always_run: true
93+
verbose: true

0 commit comments

Comments
 (0)