-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.5 KB
/
Copy pathpre-commit.yml
File metadata and controls
53 lines (43 loc) · 1.5 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
44
45
46
47
48
49
50
51
52
53
name: Pre-commit
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: pre-commit-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- uses: actions/setup-go@v5
with:
go-version: "1.24.x"
- name: Install StyLua
run: |
mkdir -p "$HOME/.local/bin"
curl --fail --location --silent --show-error \
https://github.com/JohnnyMorganz/StyLua/releases/download/v2.5.2/stylua-linux-x86_64.zip \
--output /tmp/stylua.zip
unzip -q /tmp/stylua.zip -d "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Install shfmt
run: |
go install mvdan.cc/sh/v3/cmd/shfmt@v3.14.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
# Ghostty is macOS-oriented and is intentionally validated locally; installing it on
# a macOS runner would make this otherwise fast backup check considerably slower.
run: |
python -m pip install --disable-pip-version-check pre-commit==4.6.2
SKIP=ghostty-validate-config pre-commit run --all-files