-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update github actions to allow forks run their own analysis in their own sonar cloud account (free for OSS) #120
Comments
Several updates made to GitHub actions to support this. It seems sonarcloud is expecting a lowercase organisation name. However there are no built-in expressions right now, so we had to use a workaround like this one: https://github.com/orgs/community/discussions/10553#discussioncomment-3776406 |
Try again, the merge was still running ? |
@BetimBeja if the sonar org value is different than your github repo owner it might be better to go for dedicated environment variables (ie. SONAR_ORG_NAME) and not use the github repo onwer (i.e. might be orgs where the sonar org name doesn't match their own GitHub's org name)? |
My sonar cloud org is different than my GitHub User Name 🤔 |
Aha! That makes sense so, I'll update the actions to use an environment variable instead :) |
That's merged into to the 2x-dev branch. Let me know if that works! :) @BetimBeja |
@jordimontana82 I have renamed the repository when I forked it... so I think that the |
@BetimBeja if you delete the sonar project in your org and run a new analysis it should create a new one with the new key.... |
It is what I was doing 😄 |
OK. Maybe I still have something I missed |
You need to add the 2 new github environment variables: they appear to be blank no? These are the ones I have, so yours should match your sonarcloud settings, but they should work once there is a value there.... |
Ok. I think I sorted the Sonar issue. I was using secrets instead of variables. And maybe I had some value copied wrong. Now GitHub Packages... |
@jordimontana82 do you happen to have configured these two at organization level? And I should do the same. |
https://github.com/BetimBeja/DynamicsValue_fake-xrm-easy-abstractions/blob/9442f46dac78211c744f026ed52a5b8c3a24dc92/.github/workflows/CI-2x.yml#L133 there are still some places where this is mapped to |
They're different things: PACKAGES_TOKEN is used to have read permissions to other repos for package restore (packing step) (i.e. core package needs read permission to restore the Abstractions package from GitHub packages) So that CI github actions looks fine. What error do you get now? |
@BetimBeja packages token is a PAT you need to generate with only read packages permissions. And you need to revisit the Actions sections in your repo (Settings -> Actions -> General) to give read / write permissions to the GITHUB_TOKEN (by default is read-only). |
Hey @jordimontana82, the repo url was hardcoded to DynamicsValue and I switched to |
This is about updating GitHub actions to use repository_owner as opposed to the hardcoded DynamicsValue username. This would allow anyone to build their fork against their own SonarCloud account (which is free for Open Source repos).
This seems like a straight forward alternative compared to the hacks mentioned in #97 and it would make it easier to contribute while still using SonarCloud.
Thanks to @BetimBeja for this idea.
The text was updated successfully, but these errors were encountered: