Skip to content

fix(a2a): pass safe headers to tool pre-invoke hooks #6499

fix(a2a): pass safe headers to tool pre-invoke hooks

fix(a2a): pass safe headers to tool pre-invoke hooks #6499

Workflow file for this run

# ===============================================================
# 🧪 JavaScript Unit Tests (Vitest)
# ===============================================================
# Authors: Gabriel Costa, Mihai Criveti
# - runs Vitest unit tests for browser-side JavaScript
# - uses jsdom environment to test non-modular browser scripts
# - installs dependencies from package.json / package-lock.json
# ---------------------------------------------------------------
name: JavaScript Tests (Vitest)
on:
pull_request:
types: [opened, synchronize, ready_for_review]
branches: ["main"]
paths:
- "mcpgateway/static/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- ".github/workflows/vitest.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
jobs:
ci-decision:
name: Full CI decision
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
run-full-ci: ${{ steps.decision.outputs.run-full-ci }}
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- name: Decide full CI scope
id: decision
env:
GH_TOKEN: ${{ github.token }}
WORKFLOW_FILE: vitest.yml
EVENT_NAME: ${{ github.event_name }}
EVENT_JSON: ${{ toJson(github.event) }}
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_REPOSITORY_NAME: ${{ github.repository }}
GITHUB_REF_TYPE_VALUE: ${{ github.ref_type }}
GITHUB_SHA_VALUE: ${{ github.sha }}
run: python3 .github/scripts/secret_baseline_ci_decision.py
vitest:
needs: ci-decision
if: always() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (needs.ci-decision.result != 'success' || needs.ci-decision.outputs.run-full-ci != 'false')
name: vitest
runs-on: ubuntu-slim
timeout-minutes: 15
steps:
# -----------------------------------------------------------
# 0️⃣ Checkout
# -----------------------------------------------------------
- name: ⬇️ Checkout source
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
fetch-depth: 1
# -----------------------------------------------------------
# 1️⃣ Node.js Setup
# -----------------------------------------------------------
- name: 📦 Install Node.js 20
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" \
| sudo tee /etc/apt/sources.list.d/nodesource.list > /dev/null
sudo apt-get update
sudo apt-get install -y nodejs
node --version
npm --version
# -----------------------------------------------------------
# 2️⃣ Upgrade npm to minimum required version
# -----------------------------------------------------------
- name: 🔧 Upgrade npm to minimum required version
run: sudo npm install -g npm@^11.10.0
# -----------------------------------------------------------
# 3️⃣ Install Dependencies
# -----------------------------------------------------------
- name: 📥 Install dependencies
run: npm ci
# -----------------------------------------------------------
# 4️⃣ Run Vitest
# -----------------------------------------------------------
- name: 🧪 Run Vitest
run: npx vitest run