diff --git a/.github/workflows/org-quality-gate.yml b/.github/workflows/org-quality-gate.yml index 083cc17..ced7c70 100644 --- a/.github/workflows/org-quality-gate.yml +++ b/.github/workflows/org-quality-gate.yml @@ -15,8 +15,8 @@ permissions: jobs: quality-gate: name: quality-gate - uses: agiletec-inc/github-actions/.github/workflows/quality-gate.yml@7c4b4d724552e277559a094ddd4536f9592c6e8a + uses: agiletec-inc/github-actions/.github/workflows/quality-gate.yml@cf4c5b43b92a704c9f3aa115bc7465879ddc9469 with: - source-ref: 7c4b4d724552e277559a094ddd4536f9592c6e8a + source-ref: cf4c5b43b92a704c9f3aa115bc7465879ddc9469 linux-runs-on: ${{ github.event.repository.private && 'org-shared-ci-light' || 'ubuntu-latest' }} swift-runs-on: macos-latest diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index b88b128..121597e 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -224,7 +224,12 @@ jobs: } const enriched = (payload.check_runs ?? []).map(checkRun => { const match = checkRun.details_url?.match(/\/actions\/runs\/(\d+)(?:\/|$)/); - return { ...checkRun, workflow_path: match ? runIds.get(match[1]) ?? null : null }; + return { + name: checkRun.name, + status: checkRun.status, + conclusion: checkRun.conclusion, + workflow_path: match ? runIds.get(match[1]) ?? null : null, + }; }); process.stdout.write(JSON.stringify(enriched)); NODE diff --git a/tests/test_workflow_wiring.py b/tests/test_workflow_wiring.py index 7095c7a..54ba28f 100644 --- a/tests/test_workflow_wiring.py +++ b/tests/test_workflow_wiring.py @@ -73,6 +73,12 @@ def test_native_gate_checks_pr_head_and_merge_group_sha(self) -> None: source, ) + def test_native_gate_payload_excludes_unneeded_check_run_fields(self) -> None: + source = QUALITY_GATE.read_text() + self.assertNotIn("return { ...checkRun", source) + self.assertIn("name: checkRun.name", source) + self.assertIn("workflow_path: match ? runIds.get(match[1]) ?? null : null", source) + if __name__ == "__main__": unittest.main()