diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 13a9d99..e7e105b 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -164,7 +164,7 @@ jobs: feature-flag-check: name: feature-flag-check needs: detect - if: ${{ needs.detect.outputs.heavy == 'true' }} + if: ${{ needs.detect.outputs.heavy == 'true' && needs.detect.outputs.native_required != 'true' }} uses: ./.github/workflows/feature-flag-check.yml with: runs-on: ${{ inputs.linux-runs-on }} @@ -283,6 +283,6 @@ jobs: "rust-ci": ${{ needs.detect.outputs.rust == 'true' && needs.detect.outputs.heavy == 'true' }}, "swift-ci": ${{ needs.detect.outputs.swift == 'true' && needs.detect.outputs.heavy == 'true' && needs.detect.outputs.native_required != 'true' && !github.event.repository.private }}, "secret-scan": ${{ needs.detect.outputs.native_required != 'true' }}, - "feature-flag-check": ${{ needs.detect.outputs.heavy == 'true' }}, + "feature-flag-check": ${{ needs.detect.outputs.heavy == 'true' && needs.detect.outputs.native_required != 'true' }}, "repository-gates": ${{ needs.detect.outputs.required_contexts != '[]' }}} run: node .quality-gate-source/.github/scripts/evaluate_quality_gate.mjs diff --git a/tests/test_workflow_wiring.py b/tests/test_workflow_wiring.py index 72fe5cc..990d5b3 100644 --- a/tests/test_workflow_wiring.py +++ b/tests/test_workflow_wiring.py @@ -86,6 +86,13 @@ def test_native_gate_repositories_do_not_run_duplicate_language_or_secret_gates( self.assertIn("native_required: ${{ steps.native.outputs.required_contexts != '[]' }}", source) self.assertGreaterEqual(source.count("needs.detect.outputs.native_required != 'true'"), 6) + def test_native_gate_repositories_do_not_run_duplicate_feature_flag_gate(self) -> None: + source = QUALITY_GATE.read_text() + self.assertIn( + "needs.detect.outputs.heavy == 'true' && needs.detect.outputs.native_required != 'true'", + source, + ) + def test_secret_scan_is_required_only_when_selected(self) -> None: evaluator = (ROOT / ".github/scripts/evaluate_quality_gate.mjs").read_text() self.assertIn("const required = new Set();", evaluator)