We have an existing github action setup to kickoff a SonarQube scan on branch pushes that has been running fine for a long while. Monday afternoon, the Setup action started failing with the error of:
Unable to resolve action actions/cache@v4.0.2
, unable to find version v4.0.2
We had our uses statement to:
uses: sonarsource/sonarqube-scan-action@master (now failing as of 12/9/24 afternoon)
We have tried as well:
uses: sonarsource/sonarqube-scan-action@v4.1.0 => fails with error
uses: sonarsource/sonarqube-scan-action@v4.0.0 => fails with error
uses: sonarsource/sonarqube-scan-action@v3.1.0 => works
We have gone so far as to only using the example workflow file from github marketplace to try and keep this as simple as possible but get the same results. Everything just stopped working on Monday afternoon?
I did see in action.yml (latest modifications to the file were yesterday), there is still a call us use actions/cache@v4.0.2 which I believe has been set to be deprecated? Could this be the problem?
1 Like
Hi @RowingTiger98,
Thanks for reporting the issue.
Indeed, sonarsource/sonarqube-scan-action@v4
introduces a dependency on actions/cache
, which is used to store the Sonar Scanner CLI in the GitHub cache, and avoid download it at every execution of the pipeline.
sonarsource/sonarqube-scan-action@v3
and below were based on Docker, and the Sonar Scanner CLI was baked in the sonar-scanner-cli-docker
image, which was used as a base for the Docker image of the action.
So the actions/cache
dependency is now needed.
I believe you are referring to this deprecation notice, which includes v4.0.2
. The move to latest (v4
) or to pinned SHA (v4.2.0
or v3.4.0
) should happen before February 1st 2025, and my understanding is that it should not cause outages as of now.
I have tested sonarsource/sonarqube-scan-action@master
(i.e. v4.1.0
) on a test project this morning, and the action worked successfully, retrieving actions/cache@v4.0.2
correctly:
Run actions/cache@v4.0.2
with:
path: /home/runner/work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-X64
key: sonar-scanner-cli-6.2.1.4610-Linux-X64
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
save-always: false
env:
SONAR_HOST_URL: http://localhost:9000
Cache Size: ~100 MB (105233834 B)
/usr/bin/tar -xf /home/runner/work/_temp/346e25c6-9e83-46f3-bd6f-b2a0277f615f/cache.tzst -P -C /home/runner/work/dart-tools-test1/dart-tools-test1 --use-compress-program unzstd
Received 105233834 of 105233834 (100.0%), 100.3 MBs/sec
Cache restored successfully
Cache restored from key: sonar-scanner-cli-6.2.1.4610-Linux-X64
So I would say that the upcoming deprecation should not be the cause of the issue. Could you share more about your setup? Are you running self-hosted runners in a protected setup (e.g. behind a firewall) that may prevent access to actions/cache@v4.0.2
?
I am thinking of an issue similar to this one.
Thanks,
Antonio
Hi @RowingTiger98,
We have just released a new version of the GitHub action - v4.2
.
You can read more about the new release in this community announcement or on GitHub.
We took the opportunity of releasing a new version to also change the actions/cache
from v4.0.2
to v4
.
Let us know if that helps with your issue,
Thanks
Antonio