diff --git a/.github/workflows/ci-client-cyclic-deps-check.yml b/.github/workflows/ci-client-cyclic-deps-check.yml index 4eaa0e77905f..cd75a6abfa81 100644 --- a/.github/workflows/ci-client-cyclic-deps-check.yml +++ b/.github/workflows/ci-client-cyclic-deps-check.yml @@ -27,27 +27,40 @@ jobs: with: ref: refs/pull/${{ inputs.pr }}/merge + - name: Check for changes in app/client/src + id: changed-files + uses: tj-actions/changed-files@v41 + with: + files: | + app/client/src/** + - name: Count circular dependencies on PR branch id: count-cyclic-deps-in-pr + if: steps.changed-files.outputs.any_changed == 'true' run: | npx dpdm ./src/* --circular --warning=false --tree=false > pr_circular_deps.txt pr_count=$(cat pr_circular_deps.txt | wc -l) echo "pr_count=$pr_count" >> $GITHUB_OUTPUT + cat pr_circular_deps.txt - name: Checkout release branch uses: actions/checkout@v4 + if: steps.changed-files.outputs.any_changed == 'true' with: ref: release - name: Count circular dependencies on release branch id: coun-cyclic-deps-in-release + if: steps.changed-files.outputs.any_changed == 'true' run: | npx dpdm ./src/* --circular --warning=false --tree=false > release_circular_deps.txt release_count=$(cat release_circular_deps.txt | wc -l) echo "release_count=$release_count" >> $GITHUB_OUTPUT + cat release_circular_deps.txt - name: Compare circular dependencies id: compare-deps + if: steps.changed-files.outputs.any_changed == 'true' run: | release_count=${{ steps.coun-cyclic-deps-in-release.outputs.release_count }} pr_count=${{ steps.count-cyclic-deps-in-pr.outputs.pr_count }} @@ -60,7 +73,7 @@ jobs: # Comment on the PR if cyclic dependencies are found - name: Comment the result on PR - if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' + if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' && steps.changed-files.outputs.any_changed == 'true' uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}}