name: CI on: # PR and merge queue run only the seconds-fast checks (Mason, Oct 28 2026: # merge fast, test later, fix forward daily). Main pushes run nothing; the # full matrix runs daily via nightly-full.yml and on workflow_dispatch. pull_request: branches: [main] types: [opened, synchronize, reopened] # A merge queue reruns every job on the queued merge commit so CI Gate reports there. merge_group: workflow_dispatch: inputs: validation_scope: description: Full qualification or a non-publishing native Windows diagnostic type: choice default: full options: [full, windows-native-diagnostics] # nightly-full.yml calls this workflow on a schedule to run the full matrix. workflow_call: # Scope GITHUB_TOKEN down — CI only needs to read the repo. permissions: contents: read # Cancel superseded PR runs only; every other run gets its own group. concurrency: group: ci-${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: CARGO_TERM_COLOR: always # Test and check builds keep file:line debug info (enough for panics and # backtraces) instead of full debug info. Measured on the workspace: the # target dir drops from 7.4 GB to 3.5 GB (less rust-cache to restore and # save) and a workspace rebuild over cached deps from 52s to 41s on Linux; # linking is the larger share on Windows and macOS. Release builds are # configured separately and are unaffected. CARGO_PROFILE_DEV_DEBUG: line-tables-only PHANTOM_NPM_AUDIT_VERSION: 11.15.0 jobs: # Path classification. Docs-only changes skip the Rust/web suites; secret # scanning and dependency policy always run. Pushes to main and manual runs # always run everything. The `CI Gate` job below is the single required # check, so skipped jobs never leave a required status pending. changes: name: Classify changes runs-on: ubuntu-latest timeout-minutes: 10 outputs: scope: ${{ steps.scope.outputs.scope }} rust: ${{ steps.classify.outputs.rust }} web: ${{ steps.classify.outputs.web }} temporal_example: ${{ steps.classify.outputs.temporal_example }} docs_commands: ${{ steps.classify.outputs.docs_commands }} filterset: ${{ steps.affected.outputs.filterset }} platform: ${{ steps.platform.outputs.platform }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 - name: Validate requested scope id: scope env: VALIDATION_SCOPE: ${{ inputs.validation_scope || 'full' }} GH_TOKEN: ${{ github.token }} run: node scripts/ci/validation-scope.mjs - name: Validate full scope if: steps.scope.outputs.scope == 'full' run: echo 'Canonical full scope selected' - id: classify env: EVENT: ${{ github.event_name }} BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} HEAD: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} run: | set -euo pipefail # schedule, workflow_dispatch, workflow_call and any other non-diff # event run every suite. pull_request and merge_group classify from # the same three-dot name list. Rust scope is scripts/ci/rust-scope.sh # so Lint applies that rule too (CI-PS-LINT-UNCHAIN). if [ "$EVENT" != "pull_request" ] && [ "$EVENT" != "merge_group" ]; then echo "rust=true" >> "$GITHUB_OUTPUT"; echo "web=true" >> "$GITHUB_OUTPUT" echo "temporal_example=true" >> "$GITHUB_OUTPUT" # The full Test job already runs the docs command check here. echo "docs_commands=false" >> "$GITHUB_OUTPUT"; exit 0 fi files="$(git diff --name-only "$BASE...$HEAD")" printf '%s\n' "$files" docs='^(docs/|[^/]*\.md$|.*/README\.md$|LICENSE|\.github/ISSUE_TEMPLATE/|\.github/PULL_REQUEST_TEMPLATE)' web='^(apps/web/|scripts/supabase/|scripts/seo/|\.github/workflows/)' # Rust/CLI suites: anything that is neither docs nor web-only nor the video sandbox. # scripts/supabase and scripts/seo are exercised only by the web job. rust="$(bash scripts/ci/rust-scope.sh | sed -n 's/^rust=//p')" webc=false if printf '%s\n' "$files" | grep -Eq "$web"; then webc=true; fi # The Temporal codec example (Python) has its own job. temporal=false if printf '%s\n' "$files" | grep -Eq '^(examples/temporal-codec-python/|\.github/workflows/)'; then temporal=true; fi echo "rust=$rust" >> "$GITHUB_OUTPUT"; echo "web=$webc" >> "$GITHUB_OUTPUT" echo "temporal_example=$temporal" >> "$GITHUB_OUTPUT" # Files docs_command_flags_test reads. Docs-only and web-only PRs skip # the Test job, so run that one test on its own for them. docs_commands=false if printf '%s\n' "$files" | grep -Eq '^(README\.md$|docs/[^/]+\.md$|apps/web/src/|apps/web/public/llms[^/]*\.txt$|\.github/workflows/)'; then docs_commands=true; fi echo "docs_commands=$docs_commands" >> "$GITHUB_OUTPUT" echo "rust=$rust web=$webc temporal_example=$temporal docs_commands=$docs_commands" # macOS/Windows legs (Test macOS/Windows, Windows ARM64 source check): # every non-PR event. PRs run Ubuntu only (runner capacity P0, Oct 26: # Free plan 20 jobs, 5 macOS); the Test job's `if` already skips PRs, # and CI Gate expects these legs skipped there and successful elsewhere. - id: platform env: EVENT: ${{ github.event_name }} run: | p=true if [ "$EVENT" = "pull_request" ]; then p=false; fi echo "platform=$p" >> "$GITHUB_OUTPUT"; echo "platform=$p" - id: affected env: EVENT: ${{ github.event_name }} BASE: ${{ github.event.pull_request.base.sha }} HEAD: ${{ github.event.pull_request.head.sha }} run: | if [ "$EVENT" = "pull_request" ]; then fs="$(bash scripts/ci/affected-filterset.sh "$BASE" "$HEAD" || echo 'all()')" else fs='all()' fi echo "filterset=$fs" >> "$GITHUB_OUTPUT" echo "nextest filterset: $fs" test: name: Test (${{ matrix.os }}) needs: changes if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && (needs.changes.outputs.rust == 'true' || needs.changes.outputs.scope == 'windows-native-diagnostics') runs-on: ${{ matrix.os }} timeout-minutes: 20 strategy: fail-fast: false matrix: # macOS/Windows never run on PRs; the full-matrix events (nightly # full run, workflow_dispatch) run all three OS legs. os: ${{ fromJSON(needs.changes.outputs.scope == 'windows-native-diagnostics' && '["windows-latest"]' || needs.changes.outputs.platform == 'true' && '["macos-latest", "ubuntu-latest", "windows-latest"]' || '["ubuntu-latest"]') }} env: # Linking the workspace's test binaries with link.exe is most of the # Windows Build step (86-107s vs 44s on Linux). rust-lld ships with the # toolchain; the variable only applies to the x86_64 MSVC target. # rust-cache hashes CARGO_* variables into its key, so the first run after # this changes rebuilds dependencies once (253s) before the cache warms. CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld steps: # Third-party actions are pinned to commit SHAs (not floating tags) so # a future tag-move or account compromise on the action repo cannot # inject steps into our CI. Keep the trailing `# v…` comment so # dependabot knows what version is in effect. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - uses: taiki-e/install-action@1168f6810a3cb30a3514bf5756a3b7f0422c6df8 # v2 with: tool: cargo-nextest # Coverage tools install only on Linux schedule and workflow_dispatch # (nightly-full.yml calls this workflow, so the caller's event_name is # schedule or workflow_dispatch). Pull requests, merge_group and pushes # to main skip these steps, so a merge does not pay for a second, # uncached instrumented build. - name: Install coverage tools if: runner.os == 'Linux' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 components: llvm-tools-preview - name: Install cargo-llvm-cov if: runner.os == 'Linux' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') uses: taiki-e/install-action@1168f6810a3cb30a3514bf5756a3b7f0422c6df8 # v2 with: tool: cargo-llvm-cov@0.9.1 - name: Build run: cargo build --workspace --all-targets --locked --verbose # nextest runs every test in its own process, in parallel across all # test binaries. Same targets as `cargo test --all-targets` (which never # ran doctests); ignored tests stay ignored. # PRs test only the crates the diff touches plus every crate depending on # them (nextest rdeps filterset); workspace-wide changes (manifests, # lockfile, toolchain, CI) select all(). Pushes to main always run the # complete suite on every OS. # Linux schedule and workflow_dispatch call the same nextest binary with # the same flags; merge_group uses the affected filterset like pull_request. # show-env only exports coverage variables. - name: Run tests # PRs test only crates the diff touches plus their reverse deps # (computed in `changes`); main pushes always run all(). if: needs.changes.outputs.filterset != 'none()' && (runner.os != 'Linux' || (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch')) shell: bash run: cargo nextest run --workspace --all-targets --locked --no-fail-fast -E "${{ needs.changes.outputs.filterset }}" - name: Run tests with coverage if: runner.os == 'Linux' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.filterset != 'none()' shell: bash env: # Outside ./target so rust-cache does not save the instrumented # rebuild for later pull requests. Debug info stays the workflow # line-tables-only profile. CARGO_TARGET_DIR: ${{ runner.temp }}/phantom-coverage run: | set -euo pipefail source <(cargo llvm-cov show-env --sh) cargo llvm-cov clean --workspace cargo nextest run --workspace --all-targets --locked --no-fail-fast -E "${{ needs.changes.outputs.filterset }}" mkdir -p target cargo llvm-cov report --lcov --output-path target/lcov.info if [ ! -s target/lcov.info ]; then echo "::error::coverage file target/lcov.info is missing or empty" exit 1 fi - name: Upload coverage report if: runner.os == 'Linux' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.changes.outputs.filterset != 'none()' uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: coverage-lcov path: target/lcov.info if-no-files-found: error retention-days: 1 # The X-Wing hybrid share (team_crypto_pq) and its crypto registry drift # test compile only with the pq-hybrid feature. Other jobs only # `cargo check --all-features`, so these tests never ran in CI. - name: Run pq-hybrid feature tests if: runner.os == 'Linux' && needs.changes.outputs.filterset != 'none()' run: cargo test --locked -p phantom-secrets-core --features pq-hybrid --lib -- team_crypto_pq crypto_registry - name: Verify examples run: node --test scripts/examples-first-five-minutes.test.mjs scripts/agent-first-five-minutes.test.mjs scripts/examples-client-recipes.test.mjs - name: Verify installed CLI and MCP onboarding shell: bash run: | node --input-type=module <<'NODE' import { spawnSync } from 'node:child_process'; import { join } from 'node:path'; const suffix = process.platform === 'win32' ? '.exe' : ''; const result = spawnSync(process.execPath, [ 'examples/agent-first-five-minutes/run.mjs', '--phantom', join(process.cwd(), 'target', 'debug', `phantom${suffix}`), '--mcp', join(process.cwd(), 'target', 'debug', `phantom-mcp${suffix}`), ], { stdio: 'inherit' }); if (result.error || result.signal) process.exit(1); process.exit(result.status ?? 1); NODE - name: Verify platform and installer mappings run: node scripts/check-platform-installers.mjs - name: Verify MCP platform mappings run: node npm-mcp/test/platform-matrix.test.js # The registry catalog is what MCP Registry publication ships. It was # only compared with the runtime tools/list at release build, so a tool # schema change on main (#201) left it stale until the next tag. Same # smoke and tool count as release-build.yml, against the debug build. - name: Verify MCP registry catalog matches runtime tools/list if: runner.os == 'Linux' run: node scripts/release/mcp-stdio-smoke.mjs target/debug/phantom-mcp 54 # bash -n parses without executing. The macOS leg still ships bash 3.2, # so it also catches syntax only newer bash accepts. Windows legs have # no reliable bash. - name: Check installer shell syntax if: runner.os != 'Windows' run: node --test scripts/installer-syntax.test.mjs - name: Install zsh for installer startup tests if: runner.os == 'Linux' timeout-minutes: 3 run: sudo apt-get update && sudo apt-get install -y zsh - name: Run direct installer offline tests if: runner.os == 'Linux' run: >- node --test scripts/installer-copy-byte-consistency.test.mjs scripts/installer-copy-checker.test.mjs scripts/installer-copy-comparison.test.mjs scripts/installer-copy-consistency.test.mjs scripts/installer-copy-maintenance.test.mjs scripts/installer-copy-parity.test.mjs scripts/installer-copy-source-map.test.mjs scripts/installer-copy-sync.test.mjs scripts/installer-custom-tmpdir.test.mjs scripts/installer-default-staging-root.test.mjs scripts/installer-download-failure.test.mjs scripts/installer-download-interrupt.test.mjs scripts/installer-executable-permissions.test.mjs scripts/installer-extraction-cleanup.test.mjs scripts/installer-failure-cleanup.test.mjs scripts/installer-installed-contents.test.mjs scripts/installer-missing-executable.test.mjs scripts/installer-missing-parent.test.mjs scripts/installer-missing-tool.test.mjs scripts/installer-mktemp-failure.test.mjs scripts/installer-offline-suite.test.mjs scripts/installer-path-alias-bytes.test.mjs scripts/installer-path-alias-fallback.test.mjs scripts/installer-path-alias-integration.test.mjs scripts/installer-path-alias-lookalike.test.mjs scripts/installer-path-blank-lines.test.mjs scripts/installer-path-candidate-distinct.test.mjs scripts/installer-path-candidate-spaces.test.mjs scripts/installer-path-candidate-unicode-parent.test.mjs scripts/installer-path-cd-command.test.mjs scripts/installer-path-columns-export.test.mjs scripts/installer-path-candidate-create-failure.test.mjs scripts/installer-path-comment-punctuation.test.mjs scripts/installer-path-comment-with-spaces.test.mjs scripts/installer-path-comments-integration.test.mjs scripts/installer-path-conditional-bytes.test.mjs scripts/installer-path-editor-export.test.mjs scripts/installer-path-empty-config.test.mjs scripts/installer-path-empty-file.test.mjs scripts/installer-path-existing-entry.test.mjs scripts/installer-path-final-newline.test.mjs scripts/installer-path-function-bytes.test.mjs scripts/installer-path-idempotence.test.mjs scripts/installer-path-indented-lines.test.mjs scripts/installer-path-lang-export.test.mjs scripts/installer-path-lc-all-export.test.mjs scripts/installer-path-lc-ctype-export.test.mjs scripts/installer-path-leading-comment.test.mjs scripts/installer-path-less-preservation.test.mjs scripts/installer-path-lines-export.test.mjs scripts/installer-path-literal-dollar.test.mjs scripts/installer-path-post-move-recovery.test.mjs scripts/installer-path-repeat-untouched.test.mjs scripts/installer-path-repeated-update.test.mjs scripts/installer-path-shell-export.test.mjs scripts/installer-path-shell-export-endings.test.mjs scripts/installer-path-snapshot-cleanup.test.mjs scripts/installer-path-snapshot-distinct.test.mjs scripts/installer-path-snapshot-failure.test.mjs scripts/installer-path-snapshot-spaces.test.mjs scripts/installer-path-spaced-config-dir.test.mjs scripts/installer-path-spaced-install-dir.test.mjs scripts/installer-path-spaced-lines.test.mjs scripts/installer-path-spaced-parent-full-install.test.mjs scripts/installer-path-spaced-parent-target.test.mjs scripts/installer-path-spaced-symlink-parent.test.mjs scripts/installer-path-success-cleanup.test.mjs scripts/installer-path-success-integration.test.mjs scripts/installer-path-temp-failure.test.mjs scripts/installer-path-temp-placement.test.mjs scripts/installer-path-template-names.test.mjs scripts/installer-path-templates.test.mjs scripts/installer-path-term-integration.test.mjs scripts/installer-path-trailing-newline.test.mjs scripts/installer-path-tz-export.test.mjs scripts/installer-path-unicode-comment.test.mjs scripts/installer-path-unicode-comments.test.mjs scripts/installer-path-unrelated-export.test.mjs scripts/installer-path-unrelated-final-line.test.mjs scripts/installer-path-unrelated-lines.test.mjs scripts/installer-path-unrelated-order.test.mjs scripts/installer-path-update-failure-cleanup.test.mjs scripts/installer-path-update-steps.test.mjs scripts/installer-path-visual-export.test.mjs scripts/installer-path-working-directory.test.mjs scripts/installer-success-cleanup.test.mjs scripts/public-installer-path-idempotence.test.mjs scripts/installer-promotion-failure-cleanup.test.mjs scripts/installer-stage-parent.test.mjs scripts/installer-staging-apostrophe-parent.test.mjs scripts/installer-staging-cleanup.test.mjs scripts/installer-staging-contract.test.mjs scripts/installer-staging-creation-failure.test.mjs scripts/installer-staging-directory-reference.test.mjs scripts/installer-staging-explicit-parent.test.mjs scripts/installer-staging-expression-match.test.mjs scripts/installer-staging-failure.test.mjs scripts/installer-staging-mktemp-failure.test.mjs scripts/installer-staging-prefix.test.mjs scripts/installer-staging-prefixes.test.mjs scripts/installer-staging-setup-failure.test.mjs scripts/installer-staging-spaced-home.test.mjs scripts/installer-staging-spaced-install-parent.test.mjs scripts/installer-staging-spaced-parent-offline.test.mjs scripts/installer-staging-spaced-parent.test.mjs scripts/installer-staging-spaces.test.mjs scripts/installer-staging-success.test.mjs scripts/installer-staging-tmpdir-spaces.test.mjs scripts/installer-staging-unicode-parent.test.mjs scripts/installer-staging-uniqueness.test.mjs scripts/installer-temp-environment.test.mjs scripts/installer-temporary-paths.test.mjs scripts/installer-tmpdir-fallback.test.mjs scripts/installer-unsupported-arch.test.mjs scripts/installer-unsupported-platform.test.mjs scripts/installer-unusable-parent.test.mjs scripts/installer-unwritable-tempdir.test.mjs scripts/installers.test.js scripts/public-installer-extraction-failure.test.mjs scripts/public-installer-failure-cleanup.test.mjs scripts/public-installer-staging-creation-failure.test.mjs scripts/public-installer-staging-unicode-parent.test.mjs scripts/public-installer-staging.test.mjs scripts/public-installer-tmpdir-spaces.test.mjs scripts/release/native-installer-acceptance.test.mjs scripts/installer-path-leading-indent.test.mjs scripts/installer-path-shell-fallback.test.mjs scripts/installer-path-trailing-comment.test.mjs scripts/installer-path-source-line.test.mjs scripts/installer-path-unrelated-comment.test.mjs scripts/installer-path-unrelated-comments.test.mjs scripts/installer-path-unrelated-order-integration.test.mjs scripts/installer-path-unrelated-source.test.mjs - name: Run isolated alias fallback shell test if: runner.os == 'Linux' run: bash scripts/installer-path-alias-fallback.test.sh - name: Run isolated LC_ALL preservation shell test if: runner.os == 'Linux' run: bash scripts/installer-path-lc-all.test.sh - name: Run isolated LC_CTYPE preservation shell test if: runner.os == 'Linux' run: bash scripts/installer-path-lc-ctype.test.sh - name: Run isolated LANG preservation shell test if: runner.os == 'Linux' run: bash scripts/installer-path-lang.test.sh - name: Run isolated TZ preservation shell test if: runner.os == 'Linux' run: bash scripts/installer-path-tz.test.sh - name: Run isolated COLUMNS preservation shell test if: runner.os == 'Linux' run: bash scripts/installer-path-columns.test.sh - name: Run isolated spaced-parent staging shell test if: runner.os == 'Linux' run: bash scripts/installer-staging-spaced-parent.test.sh - name: Run isolated staging-failure shell test if: runner.os == 'Linux' run: bash scripts/installer-staging-failure.test.sh && bash scripts/installers.test.sh - name: Run isolated unwritable staging-parent shell test if: runner.os == 'Linux' run: bash scripts/install-temp.test.sh - name: Parse candidate and public-reference PowerShell installers if: runner.os == 'Windows' shell: pwsh run: | $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true [void][scriptblock]::Create((Get-Content -LiteralPath scripts/install.ps1 -Raw)) [void][scriptblock]::Create((Get-Content -LiteralPath apps/web/public/install.ps1 -Raw)) node scripts/release/check-powershell-candidate.mjs if (-not (Select-String -LiteralPath apps/web/public/install.ps1 -Pattern '\$CandidateTag = ''v0.8.7''' -Quiet)) { throw 'public-reference PowerShell installer is not pinned to evidenced v0.8.7' } - name: Exercise the Windows installer with the existing debug binaries if: runner.os == 'Windows' shell: pwsh run: | $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true $archive = Join-Path $PWD 'phantom-x86_64-pc-windows-msvc.zip' Push-Location target/debug try { Compress-Archive -LiteralPath phantom.exe, phantom-mcp.exe -DestinationPath $archive } finally { Pop-Location } $version = (Get-Content -LiteralPath npm/package.json -Raw | ConvertFrom-Json).version $env:PHANTOM_NATIVE_ARCHIVE = $archive $env:PHANTOM_NATIVE_TARGET = 'x86_64-pc-windows-msvc' $env:PHANTOM_RELEASE_TAG = "v$version" node scripts/release/native-installer-acceptance.mjs # Not part of CI Gate, so a Codecov outage does not become a required check. # This is the only job in this workflow with id-token: write. It runs on # the nightly schedule and workflow_dispatch, never on pull_request, # merge_group or push. # A newer push to the same ref cancels an in-progress coverage upload. # Workflow concurrency still leaves the rest of a main push running. coverage: name: Upload coverage needs: test concurrency: group: coverage-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.test.result == 'success') }} runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read id-token: write steps: - name: Download coverage report uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: coverage-lcov path: coverage - name: Require the coverage file run: test -s coverage/lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: use_oidc: "true" version: "v11.3.1" files: coverage/lcov.info disable_search: "true" fail_ci_if_error: "false" test-ignored: name: Ignored Tests (${{ matrix.os }}) if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name == 'workflow_dispatch') }} runs-on: ${{ matrix.os }} timeout-minutes: 45 strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Run ignored tests (real OS keychain) run: cargo test --locked -p phantom-secrets-vault os_keychain_roundtrip -- --ignored lint: name: Lint if: inputs.validation_scope != 'windows-native-diagnostics' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 - name: Select Rust scope id: scope env: EVENT: ${{ github.event_name }} BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} HEAD: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} run: bash scripts/ci/rust-scope.sh | tee -a "$GITHUB_OUTPUT" # Exercise the same real permission failures before expensive Rust work. - name: Check installer shell syntax if: steps.scope.outputs.rust == 'true' run: node --test scripts/installer-syntax.test.mjs scripts/installer-unwritable-tempdir.test.mjs scripts/installer-path-success-cleanup.test.mjs - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) if: steps.scope.outputs.rust == 'true' with: toolchain: 1.95.0 components: rustfmt, clippy - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 if: steps.scope.outputs.rust == 'true' - name: Check formatting if: steps.scope.outputs.rust == 'true' run: cargo fmt --all -- --check - name: Clippy if: steps.scope.outputs.rust == 'true' run: cargo clippy --workspace --all-targets --locked -- -D warnings dependency-policy: if: inputs.validation_scope != 'windows-native-diagnostics' name: Rust dependency policy runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read env: CARGO_DENY_VERSION: 0.20.2 CARGO_DENY_SHA256: 9f12ed4c49936e09b48bf862b595cde2fe64fcbd9d74dfacac6131ca824c8d5f steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 - name: Check MCP registry publisher guards run: node --test scripts/ci/mcp-registry-publisher.test.mjs .github/tests/mcp-registry-publication.test.mjs - name: Reject tracked dependency installations shell: bash run: | set -euo pipefail /usr/bin/git ls-files -z | node scripts/release/check-dependency-index.mjs - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 - name: Restore cargo-deny archive id: cargo_deny_cache uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: /tmp/phantom-tool-cache/cargo-deny.tar.gz key: cargo-deny-${{ env.CARGO_DENY_VERSION }}-${{ env.CARGO_DENY_SHA256 }} - name: Install verified cargo-deny env: CACHE_HIT: ${{ steps.cargo_deny_cache.outputs.cache-hit }} run: | set -euo pipefail archive="/tmp/phantom-tool-cache/cargo-deny.tar.gz" install_dir="/tmp/phantom-cargo-deny-bin" mkdir -p "$install_dir" mkdir -p "$(dirname "$archive")" if [[ "$CACHE_HIT" != "true" ]]; then curl --proto '=https' --tlsv1.2 --fail --location --silent --show-error --retry 3 --retry-all-errors \ --output "$archive" \ "https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz" fi echo "${CARGO_DENY_SHA256} ${archive}" | sha256sum --check --strict - tar -xzf "$archive" -C "$install_dir" --strip-components=1 cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl/cargo-deny "$install_dir/cargo-deny" --version - name: Save verified cargo-deny archive if: ${{ steps.cargo_deny_cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: /tmp/phantom-tool-cache/cargo-deny.tar.gz key: cargo-deny-${{ env.CARGO_DENY_VERSION }}-${{ env.CARGO_DENY_SHA256 }} - name: Check advisories, licenses, bans, duplicates, and sources run: /tmp/phantom-cargo-deny-bin/cargo-deny --all-features --locked check --deny warnings advisories licenses bans sources windows-arm-source-check: name: Windows ARM64 source check needs: changes # Same platform gate as the macOS/Windows Test legs. if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.changes.outputs.rust == 'true' && needs.changes.outputs.platform == 'true') }} runs-on: windows-11-vs2026-arm timeout-minutes: 15 permissions: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 # This job compiled every dependency from scratch on each run (~2.5 min). - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Verify native host and check the workspace shell: pwsh run: | $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true $rustcDetails = rustc -vV | Out-String if ($rustcDetails -notmatch '(?m)^host: aarch64-pc-windows-msvc\r?$') { throw "expected native Windows ARM64 Rust host; got:`n$rustcDetails" } cargo check --workspace --all-targets --all-features --locked npm-wrappers: name: npm wrapper tests and package inspection needs: changes if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (needs.changes.outputs.rust == 'true') }} runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 - name: Test and inspect primary CLI wrapper on Node 22 working-directory: npm run: | npm test npm pack --dry-run - name: Test and inspect MCP wrapper on Node 22 working-directory: npm-mcp run: | npm test npm pack --dry-run - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 - name: Test primary CLI wrapper on Node 24 working-directory: npm run: npm test - name: Test MCP wrapper on Node 24 working-directory: npm-mcp run: npm test web: name: Web security, tests, and build needs: changes if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.changes.outputs.web == 'true') }} runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read defaults: run: working-directory: apps/web steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 cache: npm cache-dependency-path: apps/web/package-lock.json - name: Verify immutable migration source contract run: node --test ../../scripts/supabase/verify-migrations.test.mjs - name: Install from the lockfile run: npm ci --no-audit - name: Install the exact npm audit CLI run: | npm install \ --prefix "${RUNNER_TEMP}/phantom-npm-audit" \ --cache "${RUNNER_TEMP}/phantom-npm-audit-cache" \ --registry=https://registry.npmjs.org/ \ --ignore-scripts \ --no-audit \ --no-fund \ --no-save \ --package-lock=false \ "npm@${PHANTOM_NPM_AUDIT_VERSION}" "${RUNNER_TEMP}/phantom-npm-audit/node_modules/.bin/npm" --version | grep -Fx "${PHANTOM_NPM_AUDIT_VERSION}" - name: Audit production dependencies run: >- "${RUNNER_TEMP}/phantom-npm-audit/node_modules/.bin/npm" audit --omit=dev --audit-level=moderate - name: Lint web source run: npm run lint - name: Run web security and auth tests run: npm test - name: Verify credential-free SEO observation contract run: node --test ../../scripts/seo/observe.test.mjs ../../scripts/seo/observe-sort.test.mjs - name: Build the production application run: npm run build - name: Install pinned Supabase CLI # This exact CLI release fixes the local service-image compatibility set; # config.toml separately pins the Postgres image major version. uses: supabase/setup-cli@46f7f98c7f948ad727d22c1e67fab04c223a0520 # v3.0.0 with: version: 2.116.0 - name: Confirm exact Supabase CLI version run: test "$(supabase --version)" = "2.116.0" - id: start_database name: Start isolated local database run: supabase db start - name: Replay every migration from an empty local database run: supabase db reset --local --no-seed - name: Verify local migration history run: supabase migration list --local - name: Assert local database authority boundaries env: PGPASSWORD: postgres run: | psql --version psql --host 127.0.0.1 --port 54322 --username postgres --dbname postgres \ --file ../../scripts/supabase/assert-local-authority.sql - name: Test Data API grants and row isolation run: supabase test db --local supabase/tests/database - name: Lint local schema run: supabase db lint --local --level warning --fail-on warning - name: Run local security and performance advisors run: supabase db advisors --local --type all --level warn --fail-on warn - name: Tear down local database and delete its volumes if: ${{ always() && steps.start_database.outcome != 'skipped' }} run: supabase stop --no-backup secret-scan: if: inputs.validation_scope != 'windows-native-diagnostics' name: Source secret scan runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read env: GITLEAKS_VERSION: 8.30.0 GITLEAKS_SHA256: 79a3ab579b53f71efd634f3aaf7e04a0fa0cf206b7ed434638d1547a2470a66e steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 - name: Test verified tool downloads run: node --test scripts/ci/verified-download.test.mjs - name: Fetch canonical origin heads for history policy run: git fetch --no-tags --prune origin '+refs/heads/*:refs/remotes/origin/*' - name: Restore gitleaks archive id: gitleaks_cache uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: /tmp/phantom-tool-cache/gitleaks.tar.gz key: gitleaks-${{ env.GITLEAKS_VERSION }}-${{ env.GITLEAKS_SHA256 }} - name: Install pinned Gitleaks env: CACHE_HIT: ${{ steps.gitleaks_cache.outputs.cache-hit }} run: | set -euo pipefail archive="/tmp/phantom-tool-cache/gitleaks.tar.gz" install_dir="/tmp/phantom-gitleaks-bin" mkdir -p "$install_dir" mkdir -p "$(dirname "$archive")" if [[ "$CACHE_HIT" != "true" ]]; then curl --proto '=https' --tlsv1.2 --fail --location --silent --show-error --retry 3 --retry-all-errors \ --output "$archive" \ "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" fi echo "${GITLEAKS_SHA256} ${archive}" | sha256sum --check --strict - tar -xzf "$archive" -C "$install_dir" gitleaks "$install_dir/gitleaks" version - name: Save verified gitleaks archive if: ${{ steps.gitleaks_cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: /tmp/phantom-tool-cache/gitleaks.tar.gz key: gitleaks-${{ env.GITLEAKS_VERSION }}-${{ env.GITLEAKS_SHA256 }} - name: Scan current source with the reviewed fixture policy run: /tmp/phantom-gitleaks-bin/gitleaks dir . --config .gitleaks.toml --redact --no-banner --max-target-megabytes 5 --timeout 60 - name: Validate exact candidate and canonical-origin history policy run: | node --test scripts/release/validate-gitleaks-ignore.test.mjs node scripts/release/validate-gitleaks-ignore.mjs .gitleaksignore HEAD - name: Scan candidate and canonical origin ancestry against reviewed fingerprints run: /tmp/phantom-gitleaks-bin/gitleaks git . --log-opts='HEAD --remotes=origin' --config .gitleaks.toml --gitleaks-ignore-path .gitleaksignore --redact --no-banner --max-target-megabytes 5 --timeout 120 crate-publication-contract: name: Crate publication contract needs: changes if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.changes.outputs.rust == 'true') }} runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 components: rustfmt, clippy - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 22 - name: Test fail-closed publication and release receipts run: | node scripts/release/check-version-parity.mjs # Release-cut CHANGELOG edits drifted the fresh compare block # unnoticed; check the generated blocks, the CHANGELOG shape and the # pending changelog.d fragments on every main push. node scripts/freshness/check.mjs node scripts/release/lint-changelog.mjs node scripts/changelog-fold.mjs --check node --test scripts/examples-first-five-minutes.test.mjs scripts/publish-crates.test.js scripts/release/check-glibc-baseline.test.mjs scripts/release/extract-release-notes.test.mjs scripts/release/pre-tag-preflight.test.mjs scripts/release/readme-mcp-catalog.test.mjs scripts/release/release-receipts.test.mjs scripts/release/release-rehearsal-contract.test.mjs scripts/release/compare-release-artifacts.test.mjs scripts/release/native-installer-acceptance.test.mjs scripts/release/native-release-smoke.test.mjs scripts/release/verify-github-tag-binding.test.mjs - name: Install checksum-verified MCP Registry publisher run: bash scripts/release/install-mcp-publisher.sh - name: Validate the staged MCP Registry manifest run: /tmp/phantom-mcp-publisher-bin/mcp-publisher validate mcp-registry/server.json # fmt, clippy and the full test suite are the Lint and Test jobs; the # gate requires both, so this job only packages and verifies crates. # --publish still runs every source gate itself. - name: Package every crates.io crate in dependency order run: ./scripts/publish-crates.sh --verify-only --skip-source-gates temporal-codec-example: name: Temporal codec example tests needs: changes if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.changes.outputs.temporal_example == 'true') }} runs-on: ubuntu-latest timeout-minutes: 15 permissions: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # Runner's own python3, no extra action. Exact versions, wheels only, # every file hash-checked against requirements-ci.txt. - name: Install pinned dependencies working-directory: examples/temporal-codec-python run: | set -euo pipefail python3 --version python3 -m venv "$RUNNER_TEMP/venv" "$RUNNER_TEMP/venv/bin/pip" install --disable-pip-version-check --no-cache-dir \ --require-hashes --only-binary=:all: -r requirements-ci.txt # Fake keys only; the HTTP tests bind 127.0.0.1. A skipped test fails # the job, so a missing dependency cannot pass silently. - name: Run codec, CORS and key delivery tests working-directory: examples/temporal-codec-python run: | set -euo pipefail "$RUNNER_TEMP/venv/bin/python" -m unittest -v 2>&1 | tee "$RUNNER_TEMP/unittest.log" if grep -q 'skipped' "$RUNNER_TEMP/unittest.log"; then echo "::error::a Temporal codec example test was skipped"; exit 1 fi docs-commands: name: Docs command check needs: changes if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.changes.outputs.docs_commands == 'true') }} runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable (2026-04-24) with: toolchain: 1.95.0 - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 # Checks every documented `phantom ...` command and flag in README.md, # docs/*.md, apps/web sources and llms*.txt against the CLI's --help. - name: Documented phantom commands match the CLI run: cargo test --locked -p phantom-secrets --test docs_command_flags_test secret-shape: if: inputs.validation_scope != 'windows-native-diagnostics' # Security floor: pinned scrub.pl (sha256 5aa902ab) over the added lines of # the candidate diff, on every event. No if and no paths filter; the gate # fails closed unless this job succeeds. name: Secret-shape scan runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha || github.sha }} persist-credentials: false - name: Scan candidate diff (fail closed) env: SCRUB_SHA256: 5aa902abedbb3bf7fa8d893b93969e247c82ff62ac26cd082215caabfb740265 BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} run: | set -euo pipefail echo "${SCRUB_SHA256} .github/tests/secret-shape/scrub.pl" | sha256sum --check --strict if [ -z "${BASE_SHA}" ]; then BASE_SHA="$(git rev-parse "${HEAD_SHA}^1")"; fi base="$(git merge-base "${BASE_SHA}" "${HEAD_SHA}")" git diff --no-color --no-ext-diff "${base}" "${HEAD_SHA}" > "${RUNNER_TEMP}/candidate.diff" perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures < "${RUNNER_TEMP}/candidate.diff" # The single required status check. Fails if any job failed or was # cancelled, or if a job the classifier selected did not succeed. A job may # be skipped only when the classifier deselected it (or, for Ignored Tests, # outside workflow_dispatch). gate: name: CI Gate if: always() needs: [changes, test, test-ignored, lint, dependency-policy, windows-arm-source-check, npm-wrappers, web, secret-scan, secret-shape, crate-publication-contract, temporal-codec-example, docs-commands] runs-on: ubuntu-latest timeout-minutes: 2 permissions: {} steps: - name: Require every selected job env: NEEDS: ${{ toJSON(needs) }} EVENT: ${{ github.event_name }} run: | node <<'NODE' const needs = JSON.parse(process.env.NEEDS); const ch = needs.changes; if (ch?.result !== 'success') throw new Error(`changes: ${ch?.result}`); const scope = ch.outputs.scope; if (!['full', 'windows-native-diagnostics'].includes(scope)) throw new Error('unknown gate scope'); if (scope === 'windows-native-diagnostics') { if (process.env.EVENT !== 'workflow_dispatch') throw new Error('diagnostics require manual invocation'); const names = ['changes', 'test', 'test-ignored', 'lint', 'dependency-policy', 'windows-arm-source-check', 'npm-wrappers', 'web', 'secret-scan', 'secret-shape', 'crate-publication-contract', 'temporal-codec-example', 'docs-commands']; if (JSON.stringify(Object.keys(needs).sort()) !== JSON.stringify(names.sort())) throw new Error('diagnostic gate inventory drift'); for (const name of names) { const expected = ['changes', 'test'].includes(name) ? 'success' : 'skipped'; if (needs[name]?.result !== expected) throw new Error(`diagnostic role ${name} did not ${expected}`); } console.log('Windows diagnostic selection passed; not release qualification'); process.exit(0); } const rust = ch.outputs.rust === 'true', web = ch.outputs.web === 'true'; const temporalExample = ch.outputs.temporal_example === 'true'; const docsCommands = ch.outputs.docs_commands === 'true'; // Lint has no needs and applies the Rust scope inside the job, so a // docs-only pull request still reports success after skipping its // Rust steps. const always = ['dependency-policy', 'secret-scan', 'secret-shape', 'lint']; // PR and merge queue: daily-only jobs must be skipped. const full = process.env.EVENT !== 'pull_request' && process.env.EVENT !== 'merge_group'; const platform = ch.outputs.platform === 'true'; const rustJobs = ['npm-wrappers']; const dailyRustJobs = ['test', 'crate-publication-contract']; const expect = { ...Object.fromEntries(always.map((j) => [j, true])), ...Object.fromEntries(rustJobs.map((j) => [j, rust])), ...Object.fromEntries(dailyRustJobs.map((j) => [j, full && rust])), 'windows-arm-source-check': full && rust && platform, web: full && web, 'temporal-codec-example': full && temporalExample, 'docs-commands': full && docsCommands, 'test-ignored': process.env.EVENT === 'workflow_dispatch', }; const bad = []; for (const [job, selected] of Object.entries(expect)) { const result = needs[job]?.result; if (selected ? result !== 'success' : result !== 'skipped') bad.push(`${job}=${result} (selected=${selected})`); } const keys = ['changes', ...Object.keys(expect)].sort(); if (JSON.stringify(Object.keys(needs).sort()) !== JSON.stringify(keys)) bad.push('gate inventory drift'); if (bad.length) throw new Error(bad.join(', ')); console.log(`CI Gate passed (rust=${rust}, web=${web}, temporal_example=${temporalExample}, docs_commands=${docsCommands}, platform=${platform})`); NODE fixup-queue: # Daily red run -> READY FIXUP lines for the router queue (fix-forward owner: # ci-efficiency). One line per failed job from the needs context only: no # logs or env, read-only token, passed through the pinned scrub.pl. name: Daily fixup queue needs: [changes, test, test-ignored, lint, dependency-policy, windows-arm-source-check, npm-wrappers, web, secret-scan, secret-shape, crate-publication-contract, temporal-codec-example, docs-commands, gate] if: ${{ inputs.validation_scope != 'windows-native-diagnostics' && (always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')) }} runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read steps: - name: Checkout scrubber uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false sparse-checkout: .github/tests/secret-shape/scrub.pl sparse-checkout-cone-mode: false - name: Build fixup-queue.txt env: NEEDS: ${{ toJSON(needs) }} SCRUB_SHA256: 5aa902abedbb3bf7fa8d893b93969e247c82ff62ac26cd082215caabfb740265 run: | set -euo pipefail echo "${SCRUB_SHA256} .github/tests/secret-shape/scrub.pl" | sha256sum --check --strict sha7="${GITHUB_SHA:0:7}" run="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" printf '%s' "$NEEDS" | jq -r --arg sha7 "$sha7" --arg run "$run" --arg repo "phantom-secrets" --arg up "$(echo phantom-secrets | tr a-z- A-Z-)" ' [to_entries[] | select(.value.result == "failure" or .value.result == "cancelled")] | to_entries[] | "- READY RQ-FIXUP-\($up)-\($sha7)-\(.key + 1) (P0, pool=any, repo=\($repo), lead=CI-Efficiency, owner=ci-efficiency, job=\(.value.key), result=\(.value.value.result), run=\($run), sha=\($sha7)): daily full suite job \(.value.key) concluded \(.value.value.result); first error is in the run'"'"'s failed step."' > raw.txt perl .github/tests/secret-shape/scrub.pl < raw.txt > fixup-queue.txt echo "fixup_lines=$(wc -l < fixup-queue.txt)" cat fixup-queue.txt >> "$GITHUB_STEP_SUMMARY" - name: Upload fixup queue uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: phantom-secrets-fixup-queue path: fixup-queue.txt if-no-files-found: error retention-days: 7