Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(release): a diagnostic tar listing failed the @aisoc/mcp publish job (#729)

Beenu Arora9985c905c439
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5b20a5ec6..5536fda4f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -155,6 +155,58 @@ jobs:
- name: Build
run: pnpm --filter @aisoc/mcp build
+ # Nothing outside release.yml built or packed the publishable npm packages,
+ # so every packaging defect in them has been discoverable only on a tag —
+ # three in a row now: an unresolvable workspace dependency for `aisoc` and
+ # `@aisoc/mcp`, and a `tar | head` under pipefail that failed the job on a
+ # diagnostic line. This runs the release steps verbatim, on pull requests,
+ # against the same runner OS.
+ npm-pack:
+ name: npm — Build & pack publishable packages (${{ matrix.pkg }})
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - pkg: aisoc
+ dir: packages/aisoc-lite
+ - pkg: '@aisoc/mcp'
+ dir: services/mcp
+ - pkg: '@aisoc/sdk'
+ dir: packages/sdk-ts
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+ - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
+ with:
+ node-version: '22'
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+ - name: Install workspace
+ run: pnpm install --frozen-lockfile --ignore-scripts
+ - name: Build ${{ matrix.pkg }}
+ run: pnpm --filter '${{ matrix.pkg }}...' build
+ - name: Pack tarball
+ working-directory: ${{ matrix.dir }}
+ run: |
+ set -euo pipefail
+ pnpm pack --pack-destination "$RUNNER_TEMP"
+ TARBALL=$(ls -t "$RUNNER_TEMP"/*.tgz | head -1)
+ LISTING="$RUNNER_TEMP/tarball-listing.txt"
+ tar -tzf "$TARBALL" > "$LISTING"
+ echo "$(wc -l < "$LISTING") entries; first 20:"
+ head -20 "$LISTING"
+ - name: The bin entrypoint must exist in the tarball
+ if: matrix.pkg == '@aisoc/mcp'
+ working-directory: ${{ matrix.dir }}
+ run: |
+ set -euo pipefail
+ TARBALL=$(ls -t "$RUNNER_TEMP"/*.tgz | head -1)
+ # `bin` points at a build artifact, so a tarball missing it installs
+ # cleanly and fails on first `aisoc-mcp` invocation.
+ tar -tzf "$TARBALL" > "$RUNNER_TEMP/bin-check.txt"
+ grep -qx 'package/dist/index.js' "$RUNNER_TEMP/bin-check.txt"
+
# ──────────────────────────────────────────────
# Python API & services
# ──────────────────────────────────────────────
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4b5a4c320..247f71522 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -310,7 +310,15 @@ jobs:
TARBALL=$(ls -t "$RUNNER_TEMP"/*.tgz | head -1)
echo "tarball=$TARBALL" >> "$GITHUB_OUTPUT"
echo "version=$(node -p 'require("./package.json").version')" >> "$GITHUB_OUTPUT"
- tar -tzf "$TARBALL" | head -20
+ # Listed via a file rather than `tar ... | head`: head closes the pipe
+ # after 20 lines, GNU tar takes EPIPE and exits 2, and pipefail turns
+ # that into a failed release job. It only bites packages with more
+ # than 20 entries, so `aisoc` and `@aisoc/sdk` passed while
+ # `@aisoc/mcp` (78) failed on a diagnostic line.
+ LISTING="$RUNNER_TEMP/tarball-listing.txt"
+ tar -tzf "$TARBALL" > "$LISTING"
+ echo "$(wc -l < "$LISTING") entries; first 20:"
+ head -20 "$LISTING"
# Republishing an unchanged version is a hard error on npm, and package
# versions move independently of the monorepo tag, so most releases will