mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
Release archives now carry THIRD_PARTY_NOTICES.md, generated by scripts/gen-third-party-notices.sh from THIRD_PARTY.md, the grammar manifest, and the per-component license texts; the Homebrew formula and AUR PKGBUILD install it alongside the binary. The SBOM gains per-component license metadata, corrected versions, and the previously missing vendored libraries. The security workflow gains a vendored-license scan with an explicit allow-list policy, and the release workflow exposes a skip_perf input for releases that do not touch pipeline logic.
79 lines
3.2 KiB
YAML
79 lines
3.2 KiB
YAML
# Reusable: security-static + CodeQL gate.
|
|
# Runs independently from lint/test/build — does not block the main pipeline.
|
|
# Affects overall workflow success status.
|
|
name: Security Gate
|
|
|
|
on:
|
|
workflow_call: {}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
security-static:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
- name: "Layer 1: Static allow-list audit"
|
|
run: scripts/security-audit.sh
|
|
- name: "Layer 6: UI security audit"
|
|
run: scripts/security-ui.sh
|
|
- name: "Layer 8: Vendored dependency integrity"
|
|
run: scripts/security-vendored.sh
|
|
|
|
license-gate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
- name: Install ScanCode Toolkit
|
|
run: pipx install scancode-toolkit
|
|
- name: "License compliance gate (one finding fails)"
|
|
run: scripts/license-gate.sh
|
|
|
|
codeql-gate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 50
|
|
steps:
|
|
- name: Wait for CodeQL on current commit (max 45 min)
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
CURRENT_SHA="${{ github.sha }}"
|
|
echo "Waiting for CodeQL to complete on $CURRENT_SHA..."
|
|
for attempt in $(seq 1 90); do
|
|
LATEST=$(gh api repos/${{ github.repository }}/actions/workflows/codeql.yml/runs?per_page=5 \
|
|
--jq '.workflow_runs[] | select(.head_sha == "'"$CURRENT_SHA"'") | "\(.conclusion) \(.status)"' 2>/dev/null | head -1 || echo "")
|
|
if [ -z "$LATEST" ]; then
|
|
echo " $attempt/90: no run yet..."; sleep 30; continue
|
|
fi
|
|
CONCLUSION=$(echo "$LATEST" | cut -d' ' -f1)
|
|
STATUS=$(echo "$LATEST" | cut -d' ' -f2)
|
|
if [ "$STATUS" = "completed" ] && [ "$CONCLUSION" = "success" ]; then
|
|
echo "=== CodeQL passed ==="; exit 0
|
|
elif [ "$STATUS" = "completed" ]; then
|
|
echo "BLOCKED: CodeQL $CONCLUSION"; exit 1
|
|
fi
|
|
echo " $attempt/90: $STATUS..."; sleep 30
|
|
done
|
|
echo "BLOCKED: CodeQL timeout"; exit 1
|
|
|
|
- name: Check for open code scanning alerts
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
echo "Waiting 60s for alert API to settle..."
|
|
sleep 60
|
|
ALERTS=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' --jq 'length' 2>/dev/null || echo "0")
|
|
sleep 15
|
|
ALERTS2=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' --jq 'length' 2>/dev/null || echo "0")
|
|
[ "$ALERTS" -lt "$ALERTS2" ] && ALERTS=$ALERTS2
|
|
if [ "$ALERTS" -gt 0 ]; then
|
|
echo "BLOCKED: $ALERTS open alert(s)"
|
|
gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' \
|
|
--jq '.[] | " #\(.number) [\(.rule.security_severity_level // .rule.severity)] \(.rule.id) — \(.most_recent_instance.location.path):\(.most_recent_instance.location.start_line)"' 2>/dev/null || true
|
|
exit 1
|
|
fi
|
|
echo "=== CodeQL gate passed (0 alerts) ==="
|