Skip to content

Commit c74bdf0

Browse files
committed
chore: wire up pre-commit to run turbo fix on changed packages
1 parent e04dd22 commit c74bdf0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/ci-pre-commit.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,16 @@ jobs:
6868
sudo mv aptos /usr/local/bin/
6969
chmod +x /usr/local/bin/aptos
7070
aptos update movefmt
71+
- uses: actions/setup-node@v4
72+
with:
73+
node-version-file: "package.json"
74+
# Libusb is a build requirement for the node-hid package and so pnpm
75+
# install will fail if this isn't in the build environment and if a
76+
# precompiled binary isn't found.
77+
- name: Install libusb
78+
run: sudo apt install -y libusb-1.0-0-dev libudev-dev
79+
- uses: pnpm/action-setup@v4
80+
name: Install pnpm
81+
with:
82+
run_install: true
7183
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ repos:
2525
)
2626
- repo: local
2727
hooks:
28+
- id: turbo-fix
29+
name: Run turbo fix on packages changed since the last commit
30+
language: system
31+
entry: sh -c 'TURBO_SCM_BASE="HEAD^1" pnpm turbo fix --affected'
32+
pass_filenames: false
2833
# Hooks for the remote executor
2934
- id: cargo-fmt-remote-executor
3035
name: Cargo format for remote executor

0 commit comments

Comments
 (0)