-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Optimise fetching all commits in a pull request #416
Comments
My use case is different but the need is the same: I want to be able to list all files changed in the PR (and decide accordingly if a step needs to be run) but it can only work if the |
An easy workaround given the existing behavior may be to add an additional checkout step (first) that checks out the base ref. That way all the files get fetched, and you can do the diff after the second checkout step. I say "easy" because it's easier than scripting the fetch command yourself and formulating the correct refspec and other options :) |
what does the correct refspec look like, what's the difference with running
I don't see anything in the pull_request body that tells me how many commits to fetch if you do a shallow clone the alternative seems to be https://stackoverflow.com/a/56113247
EDIT: the |
@kellyselden I run in a similar issue and I've manage to avoid using the full fetch-depth, take a look here https://github.com/ITSRizzoli/2021-23.SA.UFS07/blob/00e213128951cbc05c2ef7ba186923da10417653/.github/workflows/scripts/pr-requirements/pr-incoming-convetional-commits-lint.sh#L26 |
To avoid using fetch-depth: 0 as seen on actions/checkout#416
To avoid using fetch-depth: 0 as seen on actions/checkout#416
|
My goal is to lint all commit messages in a pull request, or in other words, since branching off the default branch. My workaround is
but for large repos, it would be nice if this action could do the smart thing and only fetch what is needed. Thanks in advance.
The text was updated successfully, but these errors were encountered: