Skip to content

Detect off-PATH Claude Code installs + fix PS 5.1 skill install #13

Detect off-PATH Claude Code installs + fix PS 5.1 skill install

Detect off-PATH Claude Code installs + fix PS 5.1 skill install #13

Workflow file for this run

name: installer

Check failure on line 1 in .github/workflows/installer.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/installer.yml

Invalid workflow file

(Line: 93, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell, (Line: 98, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell
on:
push:
branches: [main, installer]
paths:
- 'installer/**'
- 'tests/bats/**'
- 'tests/pester/**'
- '.github/workflows/installer.yml'
pull_request:
paths:
- 'installer/**'
- 'tests/bats/**'
- 'tests/pester/**'
- '.github/workflows/installer.yml'
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run shellcheck
run: |
shellcheck -x --severity=warning \
installer/agents.sh \
installer/main.sh \
installer/lib/*.sh \
installer/hosts/*.sh
agents-ps1-encoding:
# agents.ps1 is the entry point invoked via `irm | iex`. iex doesn't strip
# a leading BOM, and Windows PowerShell 5.1 chokes on non-ASCII chars in
# source unless they're behind a BOM. The combination means agents.ps1
# specifically must stay ASCII-only and BOM-free.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify agents.ps1 encoding
run: |
python3 - <<'PY'
import sys
raw = open('installer/agents.ps1', 'rb').read()
if raw[:3] == b'\xef\xbb\xbf':
sys.exit('agents.ps1 starts with a UTF-8 BOM — irm | iex cannot parse this on Windows.')
try:
raw.decode('ascii')
except UnicodeDecodeError as e:
sys.exit(f'agents.ps1 contains non-ASCII bytes around offset {e.start}; replace with ASCII (— -> --, → -> ->, … -> ...).')
PY
bats:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install bats
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update && sudo apt-get install -y bats
else
brew install bats-core
fi
- name: Run bats tests
env:
NO_COLOR: "1"
run: bats tests/bats/
pester:
strategy:
fail-fast: false
matrix:
# `pwsh` exercises PowerShell 7+ on every OS (Linux/macOS/Windows).
# `powershell` exercises Windows PowerShell 5.1 — that's the default
# shell on a stock Windows box, and the one users get when they hit
# the Start menu and type "PowerShell". We need both to pass.
include:
- os: ubuntu-latest
shell: pwsh
- os: macos-latest
shell: pwsh
- os: windows-latest
shell: pwsh
- os: windows-latest
shell: powershell
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Pester
shell: ${{ matrix.shell }}
run: |
Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
Get-Module -ListAvailable Pester | Select-Object -First 1 Name, Version
- name: Run Pester tests
shell: ${{ matrix.shell }}
env:
NO_COLOR: "1"
run: |
$result = Invoke-Pester -Path tests/pester/ -Output Detailed -PassThru
if ($result.FailedCount -gt 0) { exit 1 }