Node 14 Error on GitHub Action

Hello,

Using SonarSource/sonarcloud-github-action@master results in the following error:
The version of node.js (12) you have used to run this analysis is deprecated and we stopped accepting it.
Please update to at least node.js 14. You can find more information here: Scanner Environment | SonarCloud Docs

The docs state as long as I’m using the GitHub Action I should be fine but it doesn’t seem to be the case.

Any idea what should be adjusted? This is breaking our workflows

2 Likes

From what I see, it seems that the GitHub action from 1.8 till the latest (currently 1.9.1) uses the SonarCloud cli docker image of version 4.8 - and that seems to have been based on nodejs 12 - which is very strange.

Checking the SonarCloud cli docker image for version 4.7 it looks like it runs on nodejs 18.

Try to move your action to work with version 1.7 which should use the old docker image that works.
I don’t know what side effects that will have, but we also woke up to a bad day, and I have been checking this to make things work.

Recently Sonar pushed a faulty docker image (SC-4361 Update sonar-scanner-cli to v4.8 (#47) · SonarSource/sonarcloud-github-action@db50107 · GitHub).

As per the other thread the workaround is to pin sonarcloud-github-action version to 1.8 (instead of master).

Hey folks,

We had a similar issue for our pipelines this morning. I did some investigations and in our case were using sonarsource/sonar-scanner-cli:latest for our image but it seems that someone on the Sonar team has built the latest image with a base image that uses Node 12.x my workaround was pinning our image to sonarsource/sonar-scanner-cli:4.7 and our pipelines are back to working as expected.

Hope that helps anyone else who comes across this issue on their Monday morning! :sweat_smile:

2 Likes