Publish curated ForgeFlow source from 2ed1787c0b52
ForgeFlow quality gate / quality (push) Successful in 4m12s
ForgeFlow quality gate / secret-scan (push) Successful in 7s

This commit is contained in:
NuklearRabbit committed 2026-09-29 22:50:57 +02:00
commit f60b269686
254 files changed
+46204

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import validation from '../src/shared/validation.cjs';
const { normalizeBaseUrl, assertCommitMessage, assertDeploymentRequest, assertHttpUrl } = validation;
test('normalizes Gitea base URL', () => {
assert.equal(normalizeBaseUrl('https://gitea.example.com/'), 'https://gitea.example.com');
});
test('rejects blank commit messages', () => {
assert.throws(() => assertCommitMessage(' '), /commit message/i);
});
test('requires exact SHA and workflow profile', () => {
assert.throws(() => assertDeploymentRequest({ branch: 'main', workflowFile: 'deploy.yml' }, 'nope'), /commit SHA/i);
});
test('accepts Unraid DockerMan WebUI placeholders only when explicitly enabled', () => {
assert.equal(assertHttpUrl('http://[IP]:[PORT:1223]/', { allowUnraidTemplate: true }), 'http://[IP]:[PORT:1223]/');
assert.throws(() => assertHttpUrl('http://[IP]:[PORT:1223]/'));
});