CI builds: Checkout main branch in a robust way #9793
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.
Adds an -f switch to force resetting the branch in cases where Circle CI had already fetched it.
I'm still not sure about the exact mechanisms of the built-in Circle CI
checkout
step. At first I introduced this in a PR wheremain
wasn't found as a reference - and it worked, the branch was added and pre-commit could compare changes in the PR tomain
.But then in a later PR after this change, I got errors when
main
already exists.https://app.circleci.com/pipelines/github/readthedocs/readthedocs.org/6345/workflows/892de4a3-b7de-4f65-80c2-d7f4643d81f3/jobs/15361
I think the
-f
switch should do the work: