I am facing is related to language detection / quality profile selection.
Since I am scanning GitHub Actions workflow files under:
**/.github/workflows/**
I expected SonarQube to detect these files as GitHub Actions and apply the GitHub Actions Quality Profile.
However, in my project, SonarQube is selecting/showing the YAML Quality Profile instead of the GitHub Actions Quality Profile.
My scanner command includes:
-Dsonar.sources="pipeline-scan-workspace"
-Dsonar.inclusions="**/.github/workflows/**/*.yml,**/.github/workflows/**/*.yaml,**/actions.yml,**/actions.yaml"
-Dsonar.githubactions.activate=true
The collected file structure is like this:
pipeline-scan-workspace/
org-a/
repo-a/
.github/
workflows/
build.yml
deploy.yml
org-b/
repo-b/
.github/
workflows/
ci.yml
Questions:
- Why is SonarQube selecting the YAML Quality Profile instead of the GitHub Actions Quality Profile for files under
.github/workflows? - Does SonarQube detect GitHub Actions language when
sonar.sourcespoints to a parent workspace folder likepipeline-scan-workspace? - Is the GitHub Actions language detection based on the full file path, or does it require the project root itself to contain
.github/workflowsdirectly? - Does using
sonar.inclusionswith**/.github/workflows/**/*.ymlaffect whether files are classified as GitHub Actions or YAML? - Is there any scanner property to force GitHub Actions language detection instead of YAML?
- Is
-Dsonar.githubactions.activate=trueenough, or is there any additional configuration needed in SonarQube? - Could this be the reason why duplication is also showing 0.0%?
Expected behavior:
.github/workflows/*.yml → GitHub Actions language → GitHub Actions Quality Profile
Actual behavior:
.github/workflows/*.yml → YAML language → YAML Quality Profile
Could you please confirm the correct configuration to make SonarQube detect these files as GitHub Actions instead of generic YAML?