Skip to content

Commit f62f6fb

Browse files
- add matrix summary policy check (#2270)
1 parent 23ac281 commit f62f6fb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/policies/branch-protection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ configuration:
2525
requiredStatusChecks:
2626
- GitOps/AdvancedSecurity
2727
- license/cla
28-
- build (16.x)
28+
- check-build-matrix
2929

3030
# TODO: all commits should be signed. We need to get everyone signing their commits.
3131
requiresCommitSignatures: false

.github/workflows/pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,17 @@ jobs:
3939
with:
4040
name: bundle
4141
path: packages/mgt/dist/bundle
42+
43+
# The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
44+
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
45+
check-build-matrix:
46+
runs-on: ubuntu-latest
47+
needs: build
48+
if: always()
49+
steps:
50+
- name: All build matrix options are successful
51+
if: ${{ !(contains(needs.*.result, 'failure')) }}
52+
run: exit 0
53+
- name: One or more build matrix options failed
54+
if: ${{ contains(needs.*.result, 'failure') }}
55+
run: exit 1

0 commit comments

Comments
 (0)