Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

fix(sage-monorepo): fix how PRs are checked out in Sonar cloud workflow #2570

Closed tschaffter closed 6 months ago

tschaffter commented 6 months ago

Closes #2567

Description

Currently, the checkout action was configured to checkout the fork, not the target repository. This led Nx to infer the base SHA from the fork repository, which is incorrect. This PR is updating the workflow to checkout the target repo instead so that the base SHA is properly identified.

Note

A potential issue is that if the workflow checkout a detached HEAD, then the name of the branch the workfow will switch to will be new-branch. This could be an issue is Sonar uses this name for multiple open PRs. Yet, two PR may have the same branch names and so the issue may already exist.