From 9f714dfed2edc928c7e2d710af82a1c2bbb40b35 Mon Sep 17 00:00:00 2001 From: hermes Date: Sat, 17 Oct 2026 05:20:46 +0000 Subject: [PATCH] fix(publisher): require the jq and bash it uses; pin CI actions From the Codex re-gate of the 0.3.3 fixes: NUL-separated discovery fields need jq 1.7 (--raw-output0) and bash 4.4 (mapfile -d); check both up front with a clear message instead of failing midway on older tools. ci.yml actions are pinned to commit SHAs like the release workflows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh --- .github/workflows/ci.yml | 8 ++++---- scripts/build-latest-ownership-snapshot.sh | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a4a52..e77d4d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Install Nix - uses: cachix/install-nix-action@v31 + uses: cachix/install-nix-action@448cde739abec1eaf0646249e3d25bb8d9bc7702 # v31 - name: Restore and save Nix store - uses: nix-community/cache-nix-action@v7 + uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7 with: primary-key: nix-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'Cargo.lock', 'Cargo.toml') }}-${{ hashFiles('crates/**', 'scripts/**', 'install.sh', 'README.md', 'LICENSE') }} restore-prefixes-first-match: | @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Test install.sh with sh run: scripts/install-sh-test.sh diff --git a/scripts/build-latest-ownership-snapshot.sh b/scripts/build-latest-ownership-snapshot.sh index 0641f25..c09fd75 100755 --- a/scripts/build-latest-ownership-snapshot.sh +++ b/scripts/build-latest-ownership-snapshot.sh @@ -126,6 +126,16 @@ if ! command -v jq >/dev/null 2>&1; then echo "jq is required for manifest/source metadata processing" >&2 exit 1 fi +# NUL-separated discovery fields need jq 1.7 (--raw-output0) and bash 4.4 +# (mapfile -d); the packaged publisher provides both. +if ! jq --raw-output0 -n '"x"' >/dev/null 2>&1; then + echo "jq 1.7 or newer is required (for --raw-output0); found $(jq --version 2>&1)" >&2 + exit 1 +fi +if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 4))); then + echo "bash 4.4 or newer is required (for mapfile -d); found ${BASH_VERSION}" >&2 + exit 1 +fi if ! "$IDX_BIN" version >/dev/null 2>&1; then echo "failed to run idx binary: $IDX_BIN" >&2