From 474c126041a775f3cbfc282ffe79d8c6fb2edb86 Mon Sep 17 00:00:00 2001 From: BryanFRD Date: Fri, 27 Nov 2026 17:05:04 +0100 Subject: [PATCH] feat(ci): add sonar-exclusions input to reusable-ci-node --- .github/workflows/reusable-ci-node.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/reusable-ci-node.yml b/.github/workflows/reusable-ci-node.yml index 1c0e655..13c1af7 100644 --- a/.github/workflows/reusable-ci-node.yml +++ b/.github/workflows/reusable-ci-node.yml @@ -123,6 +123,10 @@ on: description: 'SonarQube projectBaseDir, when it differs from working-directory (e.g. pnpm-workspace monorepos that install from the root but analyse a sub-package). Defaults to working-directory.' type: string default: '' + sonar-exclusions: + description: 'Comma-separated sonar.exclusions globs forwarded to the scan (e.g. **/__tests__/** to keep colocated tests out of the main source set). Empty keeps the scan workflow default list.' + type: string + default: '' coverage-upload-as: description: 'When set, upload this component lcov (rebased to repo-root-relative paths) under this artifact name, for a single repo-level Sonar scan to merge. Use in monorepos instead of enable-sonar to avoid sub-projects.' type: string @@ -326,6 +330,7 @@ jobs: runner: ${{ inputs.runner }} working-directory: ${{ inputs.sonar-base-dir || inputs.working-directory }} project-key: ${{ inputs.sonar-project-key }} + exclusions: ${{ inputs.sonar-exclusions != '' && inputs.sonar-exclusions || '**/node_modules/**,**/dist/**,**/build/**,**/target/**,**/coverage/**,**/.next/**,**/out/**,**/vendor/**,**/*.min.js,**/*.min.css' }} concurrency-key: ${{ inputs.concurrency-key }} coverage-artifact: ${{ (inputs.enable-test && format('sonar-coverage-{0}', inputs.sonar-project-key || github.event.repository.name)) || '' }} args: ${{ inputs.enable-test && '-Dsonar.javascript.lcov.reportPaths=.sonarcov/lcov.info' || '' }}