-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.21 KB
/
Copy pathpre-commit.yml
File metadata and controls
43 lines (36 loc) · 1.21 KB
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
34
35
36
37
38
39
40
41
42
43
---
env:
# GitHub Actions has no TTY, so force color: hk honors CLICOLOR_FORCE
# and Node tools (eslint etc.) honor FORCE_COLOR. Actions renders the ANSI.
CLICOLOR_FORCE: '1'
FORCE_COLOR: '1'
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
run:
name: Pre-Commit Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: gtbuchanan/tooling/.github/actions/mise-setup@main
# The eslint step shells out to `pnpm exec eslint`, so it needs
# node_modules. Node-free consumers set `use-pnpm: false` to skip
# this and run the builtin/tool-backed hooks alone.
- if: inputs.use-pnpm
uses: gtbuchanan/tooling/.github/actions/pnpm-tasks@main
- env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
name: Run hk on the PR's changed files
run: mise run hk:base -- "$BASE_SHA"
name: Pre-Commit
on:
workflow_call:
inputs:
use-pnpm:
default: false
description: >-
Run `pnpm install` so hk steps that shell out to the project's
pnpm deps (e.g. the `pnpm exec eslint` step) can resolve them.
Leave false when no step needs them.
type: boolean
permissions:
contents: read