kiegroup / github-action-build-chain

85 stars 24 forks source link

Replicate actions checkout to check out repositories in build chain #394

Open shubhbapna opened 1 year ago

shubhbapna commented 1 year ago

In #392 we renamed the target branch to source after merging to fix the sonar cloud issue.

I think it will be worthwhile to explore any side effects of this as well as mimic how github checks out repositories in PR just so that if we ever add a new tool like sonar cloud we will have consistent behavior.

Looking at sonarcloud-github-action, their sample workflow shows that simply using actions/checkout and running sonar cloud is enough to get PR analysis[1]. So if we can replicate how action/checkout checks out a repo during a PR we should be able to get what we want. actions/checkout by default uses GITHUB_SHA to checkout a repository which points to a test merge commit that github produces by merging source into target during a pull request event. So instead of actually cloning and then merging, it simply fetches and checks out a commit. [1] https://github.com/SonarSource/sonarcloud-github-action#usage