Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/org-quality-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion .github/workflows/quality-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/test_workflow_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()