You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current action defaults to recommending that callers ensure that the repo clone has it's full history with depth: 0 set as a option to the actions/checkout github action.
For large repos this can result in a noticeable slowdown as well as sometimes it can be easy for people to miss the requirement.
The action could add a small check when fetching tags to control whether to fetch commit history at the same time in order to allow for a more reliable check though maybe it would be better to add an option to allow users to explicitly opt in to doing this:
isShallow=$(git rev-parse --is-shallow-repository)
if [[ "${isShallow}" == "true" ]]; then
git fetch --unshallow --filter=tree:0 --refetch origin --tags
else
git fetch --tags
fi
This can be handy where people are using this action as part of another where they may not be controlling the initial clone. Instead of needing to make sure full history they can unshallow a clone to just get the commit history without downloading all the blobs. This also helps keep the action behaviour quick for larger repos.
The text was updated successfully, but these errors were encountered:
electrofelix
changed the title
Auto unshallow clones using treeless filter
Lack of commit history can cause failures when switching context from 'repo' to 'branch'
Sep 11, 2024
The current action defaults to recommending that callers ensure that the repo clone has it's full history with
depth: 0
set as a option to theactions/checkout
github action.For large repos this can result in a noticeable slowdown as well as sometimes it can be easy for people to miss the requirement.
The action could add a small check when fetching tags to control whether to fetch commit history at the same time in order to allow for a more reliable check though maybe it would be better to add an option to allow users to explicitly opt in to doing this:
This can be handy where people are using this action as part of another where they may not be controlling the initial clone. Instead of needing to make sure full history they can unshallow a clone to just get the commit history without downloading all the blobs. This also helps keep the action behaviour quick for larger repos.
The text was updated successfully, but these errors were encountered: