fix: add SonarCloud config for TypeScript CI analysis#6
Merged
Conversation
added 4 commits
June 16, 2026 12:30
SonarCloud automatic analysis fails on TypeScript repos without sonar-project.properties and npm install. Add project config, lcov coverage output, and a CI workflow for scanner upload when SONAR_TOKEN is configured.
Run the scanner on every CI pass using SONAR_TOKEN when configured, otherwise GITHUB_TOKEN (validated against SonarCloud for this org).
CLI tests require dist/ artifacts; mirror ci.yml build order.
GITHUB_TOKEN is not a valid SonarCloud scanner token. Skip the upload step when SONAR_TOKEN is missing and add a provision script for the one-time SonarCloud project import.
|
❌ The last analysis has failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sonar-project.propertieswith project keykioie_facet, source/test paths, and tsconfig for TypeScript analysis.github/workflows/sonarcloud.ymlto run SonarCloud scanner with coverage whenSONAR_TOKENis setlcovcoverage report from vitest for SonarCloud importContext
SonarCloud Code Analysis was failing on every PR/push with "The last analysis has failed" because the repo had no SonarCloud configuration. TypeScript projects require
sonar-project.propertiesand CI-based analysis (automatic analysis cannot runnpm install).Test plan
npm run lint,npm test,npm run test:coveragepasstest (20)andtest (22)pass