Skip to content

build: harden build-pr.ps1 gitleaks install (macOS arch + tar-from-stdin) - #205

Merged
Chris-Wolfgang merged 1 commit into
mainfrom
maint/build-pr-gitleaks-portability
Jul 20, 2026
Merged

build: harden build-pr.ps1 gitleaks install (macOS arch + tar-from-stdin)#205
Chris-Wolfgang merged 1 commit into
mainfrom
maint/build-pr-gitleaks-portability

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Fleet-sync of two portability improvements into this repo's local pr.yaml mirror (scripts/build-pr.ps1), found during an audit of the ETL repos' local gates:

  • macOS darwin/arm64 branch — the non-Windows gitleaks install always downloaded the Linux tarball, which fails / installs an incompatible binary on macOS (esp. Apple Silicon).
  • tar -xz -f - — read the archive from stdin explicitly; GNU tar without -f defaults to /dev/tape and can hang silently in CI / fresh shells.

Brings this repo's build-pr.ps1 in line with canonical (ETL-FixedWidth #214 / repo-template #432). Dev-tooling script only — not compiled or exercised by pr.yaml's build/test/coverage gate, so no build/test surface. PowerShell hand-verified.

…din)

Fleet-sync of two portability improvements into the local pr.yaml mirror:

- macOS darwin/arm64 branch: the non-Windows gitleaks path previously
  always downloaded the Linux tarball, which fails or installs an
  incompatible binary on macOS (esp. Apple Silicon).
- `tar -xz -f -`: read the archive from stdin explicitly; GNU tar without
  `-f` defaults to /dev/tape and can hang silently in CI / fresh shells.

Dev-tooling script only — not part of the build/test/coverage gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 02:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the local scripts/build-pr.ps1 tooling script by improving portability and reliability of the gitleaks install path on non-Windows hosts, aligning it with the canonical ETL gating scripts.

Changes:

  • Fix gitleaks archive selection on macOS by downloading the correct darwin tarball and choosing arm64 vs x64 based on detected architecture.
  • Make tar extraction explicitly read from stdin (tar ... -f -) to avoid GNU tar defaulting to /dev/tape and potentially hanging in CI shells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants