From 85d9644e3af25bb1b7ebd61a4b6bc870a4442a3c Mon Sep 17 00:00:00 2001 From: gold-silver-copper <157451540+gold-silver-copper@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:03:21 -0800 Subject: [PATCH 1/2] ci: run tests on a GitHub-hosted Linux runner instead of self-hosted Macs The tests are bash and bats with nothing macOS-specific, so ubuntu-latest runs them. Drops the sccache wrapper, which needed a persistent host, and installs bats from apt. The fork guard stays. --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d09a7cf..44a7fc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,16 +16,15 @@ jobs: run: make lint test: - # Self-hosted for sccache; fork PRs blocked for security + # Fork PRs skip this job: it uses the repo token to clone gitkb sources if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: [self-hosted, macOS, ARM64] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install git-kb from source env: GH_TOKEN: ${{ github.token }} - RUSTC_WRAPPER: sccache run: | INSTALL_DIR="${RUNNER_TEMP}/gitkb-bin" SRC="${RUNNER_TEMP}/gitkb-src" @@ -39,7 +38,7 @@ jobs: echo "$INSTALL_DIR/bin" >> "$GITHUB_PATH" - name: Install test deps - run: command -v bats >/dev/null || brew install bats-core parallel + run: sudo apt-get update && sudo apt-get install -y bats parallel - name: Verify git-kb run: git-kb --version From 2118205cc90bb03c043bcc9e6cfa75b5c78ec005 Mon Sep 17 00:00:00 2001 From: gold-silver-copper <157451540+gold-silver-copper@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:04:03 -0800 Subject: [PATCH 2/2] ci: install the released git-kb instead of building it from source The repo token can't clone the private gitkb sources from a GitHub-hosted runner. The public release is enough for these hook tests. --- .github/workflows/ci.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a7fc2..6c737d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,26 +16,23 @@ jobs: run: make lint test: - # Fork PRs skip this job: it uses the repo token to clone gitkb sources + # Fork PRs skip this job if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install git-kb from source + - name: Install released git-kb env: GH_TOKEN: ${{ github.token }} run: | INSTALL_DIR="${RUNNER_TEMP}/gitkb-bin" - SRC="${RUNNER_TEMP}/gitkb-src" - mkdir -p "$INSTALL_DIR" "$SRC/vendor" - git -c "http.https://github.com/.extraheader=AUTHORIZATION: bearer ${GH_TOKEN}" \ - clone --depth 1 https://github.com/gitkb/gitkb-core.git "$SRC/gitkb-core" - git -c "http.https://github.com/.extraheader=AUTHORIZATION: bearer ${GH_TOKEN}" \ - clone --depth 1 https://github.com/gitkb/tree-sitter-markdown.git "$SRC/vendor/tree-sitter-markdown" - cargo install --path "$SRC/gitkb-core/crates/gitkb-cli" --root "$INSTALL_DIR" - rm -rf "$SRC" - echo "$INSTALL_DIR/bin" >> "$GITHUB_PATH" + mkdir -p "$INSTALL_DIR" + cd "$RUNNER_TEMP" + gh release download -R gitkb/gitkb-releases -p 'gitkb-linux-x64.tar.gz*' + sha256sum -c gitkb-linux-x64.tar.gz.sha256 + tar -xzf gitkb-linux-x64.tar.gz -C "$INSTALL_DIR" + echo "$INSTALL_DIR" >> "$GITHUB_PATH" - name: Install test deps run: sudo apt-get update && sudo apt-get install -y bats parallel