Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][ci] Don't allow merging PR without successful result #22563

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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