@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 552968b
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 22:00 UTC

test: include public QA regressions in security gate

davoodmehraban89 committed Oct 2, 2026 at 01:09 UTC 552968b5012b3f925b59ec57df5e54b6fcf38a5f
1 file changed +10
scripts/release-safety-check.mjs
+10
@@ -1,10 +1,14 @@
1 import fs from 'node:fs';
2 +import './public-qa-regression-check.mjs';
3
4 const qa = fs.readFileSync('.github/workflows/qa.yml', 'utf8');
5 const security = fs.readFileSync('.github/workflows/security.yml', 'utf8');
6 const gate = fs.existsSync('.github/workflows/release-gate.yml')
7 ? fs.readFileSync('.github/workflows/release-gate.yml', 'utf8')
8 : '';
9 +const pages = fs.existsSync('.github/workflows/pages.yml')
10 + ? fs.readFileSync('.github/workflows/pages.yml', 'utf8')
11 + : '';
12
13 function must(condition, message) {
14 if (!condition) throw new Error(`Release safety invariant failed: ${message}`);
@@ -29,4 +33,10 @@ must(/head_sha/.test(gate), 'promotion gate must bind evidence to the exact test
33 must(/d1-request-database/.test(gate) && /c8-policy-database/.test(gate), 'promotion gate must verify database jobs, not only top-level workflow conclusion');
34 must(/Security checks/.test(gate) && /Quality checks/.test(gate), 'promotion gate must require both Quality and Security');
35
36 +must(pages.length > 0, 'gated Pages deployment workflow must exist');
37 +must(/workflows:\s*\["Release gate"\]/.test(pages), 'Pages deployment must be downstream of Release gate');
38 +must(/github\.event\.workflow_run\.conclusion == 'success'/.test(pages), 'Pages deployment must reject failed release gates');
39 +must(/github\.event\.workflow_run\.head_sha/.test(pages), 'Pages deployment must checkout the exact gated SHA');
40 +must(/scripts\/build-pages\.mjs/.test(pages), 'Pages deployment must use the hardened bounded artifact builder');
41 +
42 console.log('Release/QA safety invariants: PASS');