Files
manus-dashboard/src/backend/test/webhook-setup.test.js
2026-08-21 16:16:46 +00:00

15 lines
599 B
JavaScript

const assert = require('assert');
const fs = require('fs');
const path = require('path');
const root = path.resolve(__dirname, '../../..');
const setup = fs.readFileSync(path.join(root, 'ops/setup-gitea-webhooks.py'), 'utf8');
const compose = fs.readFileSync(path.join(root, 'docker-compose.yml'), 'utf8');
assert.match(setup, /"events": \["push", "workflow_run"\]/);
assert.match(setup, /secrets\.token_hex\(32\)/);
assert.match(setup, /method=method/);
assert.doesNotMatch(setup, /GITEA_PASSWORD/);
assert.match(compose, /WEBHOOK_SECRET=\$\{WEBHOOK_SECRET:\?/);
console.log('OK webhook setup');