Skip to content

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

@shubhbapna

Description

@shubhbapna

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-discussionneed to further discuss and determine whether it is needed or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions