Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sonar works 'on pull_request' by using SonarSource/sonarcloud-github-action #3190

Closed
wants to merge 5 commits into from

Conversation

c71n93
Copy link
Member

@c71n93 c71n93 commented May 17, 2024

Related to #2251


PR-Codex overview

This PR updates the SonarCloud workflow to include licensing information and specific paths to ignore during analysis.

Detailed summary

  • Added MIT License header
  • Specified paths to ignore during analysis
  • Updated workflow to run on specific branches and events
  • Added conditions for workflow execution based on repository and event type

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@yegor256
Copy link
Member

@c71n93 we have SONAR_TOKEN secret set for the entire organization

@c71n93
Copy link
Member Author

c71n93 commented May 17, 2024

@yegor256 Got it. I will try to figure out how to obtain it in this workflow 'on pull_request'.

@c71n93
Copy link
Member Author

c71n93 commented May 17, 2024

@yegor256 According to https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions: "With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository."

So unfortunately we can't use secrets in workflows on PR from forks and should ignore sonarcloud worflow in this cases.

@yegor256
Copy link
Member

@c71n93 so, what now? We merge this one?

@c71n93
Copy link
Member Author

c71n93 commented May 22, 2024

@yegor256 we can close this one. It looks like it is impossible to run sonar CI on PR from forks. Also we can't use this sonarcloud github action for maven project.

@c71n93 c71n93 closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants