Sonar token all of sudden failing for all repos using Github action

All of sudden our all repo failed while using Github Action for Sonar cloud scan.

ERROR: You’re not authorized to run an analysis. Please contact the project administrator.

We had organization-level SONAR_TOKEN and shared it with all repos.
I can create sonar token for eah repo and make it work but interested in:

  1. Root cause
    2 How to create single sonar token for all repos so I avoid manual work for al repos.

Please help this is urgent as we have put branch protection to pass sonar scan.

Thank you

Hey there.

  • Does this organization-level secret still exist in GitHub?
  • Does the token still exist in SonarCloud?
  • Does the user the token was generated for still have Execute Analysis permission on the repos?

Does this organization-level secret still exist in GitHub?

  • Yes
  • Does the token still exist in SonarCloud?-
    Yes

  • Does the user the token was generated for still have Execute Analysis permission on the repos?-
    No. Looks this is root cause. Now May I know how do I regenerate new token which I can use for all repos. I do have full access right for GitHub and sonarcloud to fix this. But I am unsure steps to follow to create single token for all repos.

Please help.
Thank you

Hey @Sunil_Badyankal

If the user no longer has Execute Analysis permissions, the easiest solution would be to grant that user such permissions again. No new token is required. Tokens are scoped to the user.