From 6ffe579c7dbba5ef01ab0db9b594d7c50ae52948 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 18 Jul 2024 16:19:47 -0300 Subject: [PATCH] ci: refactor CI workflow conditions to run only when PR is approved (#2805) * refactor: add check-reviews job to ci.yml * refactor(ci.yml): update path-filter condition to depend on the output of check-reviews job for improved readability and maintainability * chore(ci.yml): remove check-reviews job and update path-filter condition to check for 'lgtm' label before running the job --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 507644550..f380ccb49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ concurrency: jobs: path-filter: - # should run if the PR is approved,or if it's a manual run or if it is not a draft PR - if: ${{ (github.event.review.state == 'APPROVED' && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' }} + if: ${{ (contains( github.event.pull_request.labels.*.name, 'lgtm') && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' }} + name: Filter Paths runs-on: ubuntu-latest outputs: