Match the SonarCloud token fallback the scan actually uses (#139)

This commit is contained in:
Dylan M. Taylor authored and GitHub committed 2026-11-04 17:59:19 -05:00
1 parent e78816ca65
commit ea2cae4a03
1 file changed
+6 -1
+6 -1
View File
@@ -71,7 +71,12 @@ class SonarCloudTests(unittest.TestCase):
self.assertEqual(self.validation['if'], "steps.token.outputs.available == 'true'")
self.assertEqual(self.scan['if'], self.validation['if'])
self.assertEqual(self.scan['env']['SONAR_HOST_URL'], 'https://sonarcloud.io')
self.assertEqual(self.scan['env']['SONAR_TOKEN'], '${{ secrets.SONAR_TOKEN }}')
# The scan consumes whatever the validation step accepted: the SonarCloud PAT when the
# repo has one, otherwise the plain project token.
self.assertEqual(
self.scan['env']['SONAR_TOKEN'],
'${{ secrets.SONAR_CLOUD_PAT || secrets.SONAR_TOKEN }}',
)
self.assertEqual(
self.scan['with']['args'].splitlines()[0],
'"-Dsonar.projectKey=${{ steps.project.outputs.key }}" -Dsonar.organization=storytold '