Skip to content

Commit

Permalink
[fix][ci] Don't allow merging PR without successful result (#22563)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Apr 23, 2024
1 parent 7fe92ac commit 358c7cc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/pulsar-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1498,12 +1498,16 @@ jobs:
with:
action: wait

# This job is required for pulls to be merged.
# This job is required for pulls to be merged. This job is referenced by name in .asf.yaml file in the
# protected_branches section for master branch required_status_checks.
# It depends on all other jobs in this workflow.
# It cleans up the binaries in the same job in order to not spin up another runner for basically doing nothing.
# This job also cleans up the binaries at the end of the workflow.
pulsar-ci-checks-completed:
name: "Pulsar CI checks completed"
if: ${{ always() && needs.preconditions.result == 'success' }}
# run always, but skip for other repositories than apache/pulsar when a scheduled workflow is cancelled
# this is to allow the workflow scheduled jobs to show as cancelled instead of failed since scheduled
# jobs are not enabled for other than apache/pulsar repository.
if: ${{ always() && !(cancelled() && github.repository != 'apache/pulsar' && github.event_name == 'schedule') }}
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: [
Expand All @@ -1521,10 +1525,11 @@ jobs:
]
steps:
- name: Check that all required jobs were completed successfully
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
if: ${{ needs.preconditions.result != 'success' || needs.preconditions.outputs.docs_only != 'true' }}
run: |
if [[ ! ( \
"${{ needs.unit-tests.result }}" == "success" \
"${{ needs.preconditions.result }}" == "success" \
&& "${{ needs.unit-tests.result }}" == "success" \
&& "${{ needs.integration-tests.result }}" == "success" \
&& "${{ needs.system-tests.result }}" == "success" \
&& "${{ needs.macos-build.result }}" == "success" \
Expand Down

0 comments on commit 358c7cc

Please sign in to comment.