Skip to content

Question about fetch depth #477

Open
@gianarb

Description

@gianarb

I think this is just me not able to understand the full problem, if so please feel free to close the issue.

The easiest way I figured out to replicate my issue is via git diff, even if I have a program that does that + more logic.

This is what I want to execute:

git diff "origin/$GITHUB_HEAD_REF..origin/$GITHUB_BASE_REF

It is always empty, even if the checkout action has fetch-depth set to 0.

    - name: Checkout code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

I had to manually fetch the origin git fetch origin in order to get git diff working as I want. Is it all expected and I am just missing something huge?

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions