Skip to content

Commit be99c14

Browse files
committed
Require build-status for 8.x branch (#1752)
1 parent ff07ac1 commit be99c14

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- 8.x
77
pull_request:
8-
branches:
8+
branches:
99
- 8.x
1010
workflow_dispatch:
1111

@@ -33,8 +33,24 @@ jobs:
3333
- uses: gradle/actions/setup-gradle@v4
3434
- run: ./gradlew build --info "-PtestGradleVersion=${{ matrix.gradle }}"
3535

36+
# Status check that is required in branch protection rules.
37+
build-status:
38+
needs:
39+
- build
40+
runs-on: ubuntu-24.04-arm
41+
if: always()
42+
steps:
43+
- name: Check
44+
run: |
45+
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
46+
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
47+
echo "One or more required jobs failed"
48+
exit 1
49+
fi
50+
echo "All required jobs completed successfully."
51+
3652
publish-snapshot:
37-
needs: build
53+
needs: build-status
3854
runs-on: ubuntu-latest
3955
if: github.repository == 'GradleUp/shadow' && github.ref == 'refs/heads/main'
4056
steps:

0 commit comments

Comments
 (0)