From 0ae38e76c17215a37636d08d2b21de8c7fa2af17 Mon Sep 17 00:00:00 2001 From: Colton Padden Date: Fri, 11 Sep 2026 20:53:24 -0400 Subject: [PATCH 1/2] ci: run pre-commit checks --- .github/workflows/pre-commit.yml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..ab73483 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,48 @@ +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" + + - uses: JohnnyMorganz/stylua-action@v1.1.2 + with: + version: v2.5.2 + + - 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 From 561e9e5b545dd20056c6a6522c7808769722785a Mon Sep 17 00:00:00 2001 From: Colton Padden Date: Fri, 11 Sep 2026 20:54:25 -0400 Subject: [PATCH 2/2] ci: install StyLua without action token --- .github/workflows/pre-commit.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ab73483..a839310 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -26,9 +26,14 @@ jobs: with: go-version: "1.24.x" - - uses: JohnnyMorganz/stylua-action@v1.1.2 - with: - version: v2.5.2 + - 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: |