Change Sonar to Codacy
Description
PR to test the sonar analysis being triggered by PRs raised from forks. This PR is being raised from my fork to test it.
Checklist
- [x] I have read and understand the contributing guidelines
- [ ] This PR fixes a defect, and I have provided tests to verify that the fix is effective
- [ ] This PR implements an enhancement, and I have provided tests to verify that it works as intended
- [ ] This PR introduces changes to the database model, and I have updated the migration changelog accordingly
- [ ] This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
@sahibamittal If this turns out to be too finicky to resolve, I think we can make the decision to simply ditch Sonar altogether. All other repos use Codacy. We could just copy-paste the solution we implemented in the other repos.
@sahibamittal If this turns out to be too finicky to resolve, I think we can make the decision to simply ditch Sonar altogether. All other repos use Codacy. We could just copy-paste the solution we implemented in the other repos.
Yes, we can do that but issue I'm facing here is with downloading the artifact (before performing sonar analysis) due to error : Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'id')
It is not able to read the workflow_run.id in below script:
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
I can see artifacts beings created here.
https://github.com/DependencyTrack/hyades/issues/1203