mirror of
https://github.com/redwoodjs/local-ci.git
synced 2026-09-19 07:54:29 +08:00
ef7029adf3
Replace mutable tag refs (@v4, @v5, @v1, @main) with 40-char commit SHAs and a trailing `# vX.Y.Z` comment, per GitHub's hardening guidance. Covers .github/workflows/, .docs/marketing/demo-recording/, and the skill-evals fixture repos. Embedded YAML inside heredocs is also pinned. No packages/ code changes, so no changeset.
51 lines
2.0 KiB
YAML
51 lines
2.0 KiB
YAML
name: "Smoke: Binary"
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, labeled, synchronize]
|
|
|
|
jobs:
|
|
binary-smoke:
|
|
name: Binary Smoke
|
|
if: '!github.event.pull_request.draft && (contains(fromJSON(''["MEMBER", "OWNER", "COLLABORATOR"]''), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, ''safe-to-run''))'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
|
|
with:
|
|
version: 10.30.1
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: 22
|
|
cache: "pnpm"
|
|
- run: pnpm install
|
|
- run: pnpm --filter @redwoodjs/agent-ci... -r build
|
|
- name: Verify shebang
|
|
run: |
|
|
head -1 packages/cli/dist/cli.js | grep -q '#!/usr/bin/env node'
|
|
echo "✅ Shebang is correct"
|
|
- name: Run built binary (node)
|
|
run: |
|
|
set +e
|
|
output=$(node packages/cli/dist/cli.js 2>&1)
|
|
exit_code=$?
|
|
set -e
|
|
echo "$output"
|
|
[ "$exit_code" -eq 1 ] || (echo "❌ Expected exit code 1, got $exit_code" && exit 1)
|
|
echo "$output" | grep -q "Usage: agent-ci" || (echo "❌ Usage text not found" && exit 1)
|
|
echo "✅ Built binary executes correctly via node"
|
|
- name: Run built binary (npx)
|
|
run: |
|
|
set +e
|
|
output=$(npx --yes ./packages/cli 2>&1)
|
|
exit_code=$?
|
|
set -e
|
|
echo "$output"
|
|
[ "$exit_code" -eq 1 ] || (echo "❌ Expected exit code 1, got $exit_code" && exit 1)
|
|
echo "$output" | grep -q "Usage: agent-ci" || (echo "❌ Usage text not found in npx output" && exit 1)
|
|
echo "✅ Built binary executes correctly via npx"
|