<< All versions

Skill v1.0.1

currentAutomated scan100/100
loerei/myskills/sonarcloud-ci-workflow

+4 new

──Details
PublishedNovember 27, 2026 at 10:08 PM
Content Hashsha256:11844fc3b6659a98...
Git SHA74eb9a43c512
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 1.6 KB)
SKILL.md1.6 KBactive
SKILL.md · 26 lines · 1.6 KB

name: sonarcloud-ci-workflow description: Use when configuring, optimizing, or troubleshooting SonarCloud CI workflows in GitHub Actions. metadata: version: "1.0.1"


SonarCloud CI Workflow

For property templates, workflow YAML, PR check commands, and CI troubleshooting, see REFERENCE.md.

Workflow

  1. Configure GitHub Secret: Ask the user for their SonarCloud token and run gh secret set SONAR_TOKEN --body "<token>".
  2. Configure `sonar-project.properties`: Save as UTF-8 without BOM in the project root:
  • Set sonar.sources and exclusions to prevent false-positive duplication checks on test and build files.
  • Add sonar.coverage.exclusions=**/* on free plans to bypass coverage gate requirements.
  1. Write `.github/workflows/sonarcloud.yml`:
  • Match the repository's default branch trigger (main or master).
  • Static Analysis (Fast): Omit dependency installation; run checkout (fetch-depth: 0) and SonarSource/sonarqube-scan-action@v6. NEVER use deprecated SonarSource/sonarcloud-github-action or outdated v5 scanner actions.
  • Coverage Analysis: Enable Node caching (cache: 'npm'), run builds before tests in monorepos, and use npm install instead of npm ci when platform-specific native binaries cause EBADPLATFORM errors.
  1. Disable Automatic Analysis: In SonarCloud Administration -> Analysis Method, toggle Automatic Analysis OFF.
  2. Verify & Troubleshoot:
  • Follow sonar-remediation for pre-push code quality checks.
  • On CI failures, check Section 6 of REFERENCE.md for race conditions, CRLF line endings, and BOM errors.
← v1.0.0All versions