Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about fetch depth #477

Open
gianarb opened this issue Apr 16, 2021 · 2 comments
Open

Question about fetch depth #477

gianarb opened this issue Apr 16, 2021 · 2 comments

Comments

@gianarb
Copy link

gianarb commented Apr 16, 2021

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

@zhangyi921
Copy link

Not sure if this is going to help. I have this same phenomenon if I run the job inside docker docker container, but doesn't have this phenomenon when I run it in a nodejs docker image. Never figured out why as it doesn't bother me.

@leocwolter
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants