Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Tweaks the
actions/checkout
behavior incloud-actions/og/bump
to fetch the minimum number of commits required to do its job. Previously this was fetching all history for branches in the whole repo.This action now only fetches:
Details
This change can save significant amounts of time during the checkout actions for large repos with many branches.
Additionally, it should no-longer be necessary to specify
fetch-depth: 0
in checkout actions that precede the sharedcloud-actions
(unless some other custom workflow step needs this full git history). The changes here were heavily based on this comment.References
See https://github.com/XanaduAI/gittagtest/pull/28 for tests
See real-world example on https://github.com/XanaduAI/chip-data-analysis/pull/196:
cloud-actions/bump@main : job link (1m38s)
cloud-actions/bump@bump_pulls_less_files: job link (3s)
Notes
I would encourage testing this by temporarily pointing other real workflows (ideally before opening a PR) to this cloud-actions branch to confirm there aren't any unforeseen issues.
Additionally, for workflows where the
cloud-actions
are preceded by anactions/checkout
action with afetch-depth: 0
, you will not see any time savings until the initial fetch-depth argument is removed. Multiple repos I looked at currently do this. I'd recommend removing this argument while doing the aforementioned test.Last minor note, there is a node deprecation warning caused by
actions/checkout@v3
. I've tested this change usingv4
and had no issues, but bumping that dependency felt outside the scope of this already kinda complicated PR.