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