Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/matrix-bridge-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Matrix Bridge CI

on:
push:
branches: [main]
paths:
- 'replicas-matrix-bridge/**'
- '.github/workflows/matrix-bridge-ci.yml'
pull_request:
paths:
- 'replicas-matrix-bridge/**'
- '.github/workflows/matrix-bridge-ci.yml'

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: replicas-matrix-bridge
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test

auth-gate-smoke-test:
name: Auth gate smoke test
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Assert /admin/listener/reset returns 401 without ADMIN_TOKEN
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST https://replicas-matrix-bridge.jadengarza.workers.dev/admin/listener/reset)
echo "no-auth status: $STATUS"
if [ "$STATUS" != "401" ]; then
echo "❌ /admin/listener/reset returned $STATUS without auth (expected 401)"
echo "The ADMIN_TOKEN gate has regressed — every admin/debug endpoint is exposed."
exit 1
fi
echo "✅ Auth gate is enforced on /admin/* endpoints"

- name: Assert /debug/listener returns 401 without ADMIN_TOKEN
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-X GET https://replicas-matrix-bridge.jadengarza.workers.dev/debug/listener)
echo "no-auth status: $STATUS"
if [ "$STATUS" != "401" ]; then
echo "❌ /debug/listener returned $STATUS without auth (expected 401)"
exit 1
fi
echo "✅ Auth gate is enforced on /debug/* endpoints"

- name: Assert /health stays public (no auth required)
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-X GET https://replicas-matrix-bridge.jadengarza.workers.dev/health)
echo "/health status: $STATUS"
if [ "$STATUS" != "200" ]; then
echo "❌ /health returned $STATUS (expected 200 — must stay public for uptime checks)"
exit 1
fi
echo "✅ /health is public"
Loading