diff --git a/.github/workflows/bencher-ab.yml b/.github/workflows/bencher-ab.yml index 3ad0e3930c04..4c53ab7b27ec 100644 --- a/.github/workflows/bencher-ab.yml +++ b/.github/workflows/bencher-ab.yml @@ -22,7 +22,15 @@ jobs: 1ES.Pool=gha-vmss-d16av5-ci, "JobId=bab_benchmark_pr-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}", ] - if: ${{ contains(github.event.pull_request.labels.*.name, 'bench-ab') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}} + if: &check_trigger_conditions >- + ${{ + (github.event.action == 'labeled' + && github.event.label.name == 'bench-ab') + || (github.event.action != 'labeled' + && contains(github.event.labels.*.name, 'bench-ab')) + || github.event_name == 'workflow_dispatch' + || github.event_name == 'schedule' + }} container: image: mcr.microsoft.com/azurelinux/base/core:3.0 options: --user root @@ -72,7 +80,7 @@ jobs: 1ES.Pool=gha-vmss-d16av5-ci, "JobId=bab_benchmark_main-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}", ] - if: ${{ contains(github.event.pull_request.labels.*.name, 'bench-ab') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}} + if: *check_trigger_conditions container: image: mcr.microsoft.com/azurelinux/base/core:3.0 options: --user root @@ -127,7 +135,7 @@ jobs: image: mcr.microsoft.com/azurelinux/base/core:3.0 options: --user root needs: [benchmark_pr, benchmark_main] - if: ${{ contains(github.event.pull_request.labels.*.name, 'bench-ab') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}} + if: *check_trigger_conditions steps: - name: Setup container dependencies run: | diff --git a/.github/workflows/long-test.yml b/.github/workflows/long-test.yml index dded91dcb932..5c66db255887 100644 --- a/.github/workflows/long-test.yml +++ b/.github/workflows/long-test.yml @@ -19,7 +19,15 @@ permissions: read-all jobs: long-asan: - if: &check_trigger_conditions ${{ contains(github.event.pull_request.labels.*.name, 'run-long-test') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'}} + if: &check_trigger_conditions >- + ${{ + (github.event.action == 'labeled' + && github.event.label.name == 'run-long-test') + || (github.event.action != 'labeled' + && contains(github.event.labels.*.name, 'run-long-test')) + || github.event_name == 'workflow_dispatch' + || github.event_name == 'schedule' + }} name: "ASAN" runs-on: [ diff --git a/.github/workflows/long-verification.yml b/.github/workflows/long-verification.yml index a2e57d1db0cb..e78a9443d15e 100644 --- a/.github/workflows/long-verification.yml +++ b/.github/workflows/long-verification.yml @@ -20,7 +20,15 @@ permissions: read-all jobs: model-checking-with-atomic-reconfig-consensus: name: Model Checking With Atomic Reconfig - Consensus - if: ${{ contains(github.event.pull_request.labels.*.name, 'run-long-verification') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} + if: &check_trigger_conditions >- + ${{ + (github.event.action == 'labeled' + && github.event.label.name == 'run-long-verification') + || (github.event.action != 'labeled' + && contains(github.event.labels.*.name, 'run-long-verification')) + || github.event_name == 'workflow_dispatch' + || github.event_name == 'schedule' + }} runs-on: [ self-hosted, @@ -58,7 +66,7 @@ jobs: model-checking-with-reconfig-consensus: name: Model Checking With Reconfig - Consensus - if: ${{ contains(github.event.pull_request.labels.*.name, 'run-long-verification') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} + if: *check_trigger_conditions runs-on: [ self-hosted, @@ -96,7 +104,7 @@ jobs: simulation-consensus: name: Simulation - Consensus - if: ${{ contains(github.event.pull_request.labels.*.name, 'run-long-verification') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} + if: *check_trigger_conditions runs-on: ubuntu-latest defaults: run: