actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.94k stars 1.77k forks source link

fetch-depth question #1734

Open y-nk opened 6 months ago

y-nk commented 6 months ago

I've set fetch-depth to ${{ github.event.pull_request.commits }} to avoid fetching my whole repo. The action executes like this:

image

So then i would expect to have 12 commits (11 + the merge commit) in the rev-list, but i get much more than this.

image

not sure why. could somebody tell me if it's normal?

davhdavh commented 5 months ago

The default is to only download the files specifically for the commit you are building, ie fetch-depth:1 is what you want.

y-nk commented 5 months ago

i would like to add that i do not use the /merge in ref, so fetch: 1 does not match. i'd like to checkout consistently [github.event.before, ..., github.event.pull_request.head.sha]