chore: use actions/checkout@(v1, v2) to v3 #2522
Merged
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.
Upgrading from
actions/checkout@v1
oractions/checkout@v2
to@v3
.I had an interesting CI failure today: https://github.com/dfinity/sdk/runs/8102506163?check_suite_focus=true
When the e2e build_dfx (ubuntu) step ran, it checked out one merge commit, and built the dfx binary:
Then, another PR was merged to master. The merged PR contained a new test, and a new dfx command. The binary built above did not contain the new command that the new test required, because it was built from a commit when that command did not exist.
Next, the dfx/info tests ran, using the binary built from the earlier step, but checked out the repo at a different (newer) merge commit:
The result was a test failure.
It seems strange that the default checkout behavior would cause different jobs from the same workflow for the same pull request event to check out different merge commits. This issue describes the problem exactly, but is closed without a resolution. I've seen suggestions to use the pull request HEAD commit instead of MERGE commit, but it's unclear how this would work for workflows that also run on push.
While it seems clear that the correct behavior would be to use a consistent merge commit, using the base commit from the pull request event rather than the head of the base branch at the instant of any given checkout, I have no reason to believe that
actions/checkout@v3
fixes this issue. At the same time there is no good reason to use some v1, some v2, and some v3.