test(deploy): prove central workflow carries signed target
ChatGPT validation / quality (push) Failing after 0s
ChatGPT validation / quality (push) Failing after 0s
This commit is contained in:
@@ -6,10 +6,11 @@ const workflowUrl = new URL('../examples/gitea-actions/forgeflow-approved-deploy
|
|||||||
const deployUrl = new URL('../examples/server/forgeflow-deploy', import.meta.url);
|
const deployUrl = new URL('../examples/server/forgeflow-deploy', import.meta.url);
|
||||||
|
|
||||||
|
|
||||||
test('approved workflow transports immutable evidence only to the root-owned deploy wrapper', async () => {
|
test('central approved workflow transports signed target evidence only to the root-owned deploy wrapper', async () => {
|
||||||
const workflow = await readFile(workflowUrl, 'utf8');
|
const workflow = await readFile(workflowUrl, 'utf8');
|
||||||
|
|
||||||
for (const input of [
|
for (const input of [
|
||||||
|
'repository',
|
||||||
'environment',
|
'environment',
|
||||||
'commit_sha',
|
'commit_sha',
|
||||||
'request_id',
|
'request_id',
|
||||||
@@ -20,7 +21,8 @@ test('approved workflow transports immutable evidence only to the root-owned dep
|
|||||||
]) {
|
]) {
|
||||||
assert.match(workflow, new RegExp(`\\b${input}:`));
|
assert.match(workflow, new RegExp(`\\b${input}:`));
|
||||||
}
|
}
|
||||||
assert.match(workflow, /\$\{\{ gitea\.repository \}\}/);
|
assert.match(workflow, /\$\{\{ inputs\.repository \}\}/);
|
||||||
|
assert.doesNotMatch(workflow, /\$\{\{ gitea\.repository \}\}/);
|
||||||
assert.match(workflow, /FF_APPROVAL_ID.*FF_REQUEST_ID/s);
|
assert.match(workflow, /FF_APPROVAL_ID.*FF_REQUEST_ID/s);
|
||||||
assert.match(workflow, /sudo \/usr\/local\/bin\/forgeflow-deploy/);
|
assert.match(workflow, /sudo \/usr\/local\/bin\/forgeflow-deploy/);
|
||||||
assert.doesNotMatch(workflow, /actions\/checkout/);
|
assert.doesNotMatch(workflow, /actions\/checkout/);
|
||||||
|
|||||||
Reference in New Issue
Block a user