Repository navigation
ci: run the hook suites on macOS's stock bash and the secret-scan test cross-platform - #778
Merged
addyosmani merged 1 commit intoNov 14, 2026
Conversation
…t cross-platform The hook suites run only on ubuntu-latest, under bash 5. The hooks run under whatever bash the host has, and the versions disagree: 7b31a90 fixed protected blocks corrupted under bash 5.2 on Linux while macOS stayed clean. A regression in the other direction, a bash 4 construct the stock /bin/bash 3.2 on a Mac rejects, has no CI coverage at all. Make the hooks job an ubuntu and macOS matrix, put /bin first on macOS so the suites run under bash 3.2, and print bash and jq so a missing jq cannot turn the round-trip tests into silent skips. Both suites pass under /bin/bash 3.2 locally: 29 and 74 checks. Also add scripts/staged-secret-scan-test.js (from addyosmani#718) to the hand-kept node --test list of the macOS and Windows job. It ran on Linux only.
addyosmani
approved these changes
Nov 14, 2026
addyosmani
left a comment
Owner
There was a problem hiding this comment.
praise: stock bash 3.2 is what a Mac without Homebrew runs, so this covers a real gap, and the jq --version step stops the macOS leg from silently skipping. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two CI coverage gaps, both in
.github/workflows/test-plugin-install.yml, so one PR.1. The hook suites never run on macOS
test-hooksrunssdd-cache-test.shandsimplify-ignore-test.shonubuntu-latestonly, under bash 5. The hooks run under whatever bash the host has, and the versions have already disagreed in this repo: 7b31a90 fixed protected blocks being corrupted under bash 5.2 on Linux, a bug invisible on macOS because bash 3.2 has nopatsub_replacement. The reverse failure, a bash 4 construct (declare -A,mapfile,${var,,}) that the stock/bin/bash3.2 on a Mac rejects, has no coverage. A Mac without Homebrew bash runs the hooks under 3.2.The job becomes an
ubuntu-latestandmacos-latestmatrix. On macOS,/bingoes first onPATH, so the suites, and thebash hooks/...calls they make, run under the stock 3.2 rather than a newer bash the runner image may carry. A first step printsbash --versionandjq --version. The jq check matters because without jq both suites skip their round-trip tests and still pass, so a runner without jq would turn the macOS leg into a silent no-op.Locally, with the same
PATHprefix on macOS (bash 3.2.57, jq 1.7.1):sdd-cache-test.sh29 passed,simplify-ignore-test.sh74 passed. Nothing fails today. This guards a known class of failure, not a hypothetical one.2. The staged-secret-scan test runs on Linux only
scripts/staged-secret-scan-test.jsarrived with #718 and has a step in the Linux job, but it is missing from the hand-keptnode --testlist invalidate-platforms, which you pointed out on #671 is a list, not a glob. Added. It passes on macOS locally. On Windows it shells out tobashand skips itself if none is available, so the worst case there is a skip, not a failure; the run will show which.Overlap
#665 and #548 each add a test file to the same
node --testlist, so whichever of the three merges second needs a one-line rebase. No other open PR touches these lines.