diff --git a/.github/workflows/repo-required-gate.yml b/.github/workflows/repo-required-gate.yml index b78ca4e..07b1fed 100644 --- a/.github/workflows/repo-required-gate.yml +++ b/.github/workflows/repo-required-gate.yml @@ -576,9 +576,9 @@ jobs: OK: ${{ needs.detect.outputs.ok }} RUN_NODE_CI: ${{ needs.detect.outputs.run-node-ci }} RUN_PYTHON_CI: ${{ needs.detect.outputs.run-python-ci }} - RUN_DEPENDENCY_REVIEW: ${{ needs.detect.outputs.run-dependency-review }} - RUN_WORKFLOW_VALIDATION: ${{ needs.detect.outputs.run-workflow-validation }} - RUN_POLICY_VALIDATION: ${{ needs.detect.outputs.run-policy-validation }} + RUN_DEPENDENCY_REVIEW: ${{ inputs.run-dependency-review && needs.detect.outputs.run-dependency-review == 'true' }} + RUN_WORKFLOW_VALIDATION: ${{ inputs.run-workflow-validation && needs.detect.outputs.run-workflow-validation == 'true' }} + RUN_POLICY_VALIDATION: ${{ inputs.run-policy-validation && needs.detect.outputs.run-policy-validation == 'true' }} RUN_SNAPSHOT_VALIDATION: ${{ needs.detect.outputs.run-snapshot-validation }} DETECT_RESULT: ${{ needs.detect.result }} CONTRACT_RESULT: ${{ needs.pr-contract.result }} diff --git a/scripts/pr-contract.mjs b/scripts/pr-contract.mjs index ea945b9..709d210 100644 --- a/scripts/pr-contract.mjs +++ b/scripts/pr-contract.mjs @@ -1,4 +1,3 @@ -#!/usr/bin/env node import { execFileSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; diff --git a/scripts/workflow-structure.test.mjs b/scripts/workflow-structure.test.mjs index 901ea5a..4bf1470 100644 --- a/scripts/workflow-structure.test.mjs +++ b/scripts/workflow-structure.test.mjs @@ -88,6 +88,21 @@ describe('repo-required-gate workflow node delegation', () => { } }); + it('honors optional validation inputs in the decision job', () => { + const body = readWorkflow('repo-required-gate'); + const block = workflowJobBlock(body, 'decision'); + + expect(block).toContain( + "RUN_DEPENDENCY_REVIEW: ${{ inputs.run-dependency-review && needs.detect.outputs.run-dependency-review == 'true' }}", + ); + expect(block).toContain( + "RUN_WORKFLOW_VALIDATION: ${{ inputs.run-workflow-validation && needs.detect.outputs.run-workflow-validation == 'true' }}", + ); + expect(block).toContain( + "RUN_POLICY_VALIDATION: ${{ inputs.run-policy-validation && needs.detect.outputs.run-policy-validation == 'true' }}", + ); + }); + it('declares the doc-only inputs passed to the shared PR contract validator', () => { const body = readWorkflow('repo-required-gate');