From 77fef8732bff67229440114cbc10d08bb776a4db Mon Sep 17 00:00:00 2001 From: Bart Date: Mon, 25 Aug 2025 13:32:07 -0400 Subject: [PATCH] fix: Simplify PR pipeline trigger rules (#5727) This change removes `labeled` and `unlabeled` as pipeline trigger actions, and instead adds `reopened` and `ready_for_review`. The logic whether to run the pipeline jobs is then simplified, although to get a draft PR with the `DraftCIRun` label to run it can be necessary to close and reopen a PR. --- .github/workflows/on-pr.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index d1623874ac..e626222865 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -31,9 +31,9 @@ on: - "conanfile.py" types: - opened + - reopened - synchronize - - labeled - - unlabeled + - ready_for_review concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -48,24 +48,10 @@ env: CONAN_REMOTE_URL: https://conan.ripplex.io jobs: - # This job determines whether the workflow should run. It runs when: - # * Opened as a non-draft PR. - # * A commit is added to a non-draft PR or the PR has the 'DraftRunCI' label. - # * A draft PR has the 'DraftRunCI' label added. - # * A non-draft PR has the 'DraftRunCI' label removed. - # These checks are in part to ensure the workflow won't run needlessly while - # also allowing it to be triggered without having to add a no-op commit. A new - # workflow execution can be triggered by adding and then removing the label on - # a non-draft PR, or conversely by removing it and then adding it back on a - # draft PR; this can be useful in certain cases. + # This job determines whether the workflow should run. It runs when the PR is + # not a draft or has the 'DraftRunCI' label. should-run: - if: >- - ${{ - (github.event.action == 'opened' && !github.event.pull_request.draft) || - (github.event.action == 'synchronize' && (!github.event.pull_request.draft || contains(github.event.pull_request.labels.*.name, 'DraftRunCI'))) || - (github.event.action == 'labeled' && github.event.pull_request.draft && github.event.label.name == 'DraftRunCI') || - (github.event.action == 'unlabeled' && !github.event.pull_request.draft && github.event.label.name == 'DraftRunCI') - }} + if: ${{ !github.event.pull_request.draft || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }} runs-on: ubuntu-latest steps: - name: No-op