-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3415: Spurious clone failures in CI #3432
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.drone.yml
Outdated
- git init | ||
- git remote add origin $DRONE_REMOTE_URL | ||
- git fetch --no-tags origin $DRONE_COMMIT_REF | ||
- if [ $DRONE_BUILD_EVENT == "push" ]; then git reset --hard -q $DRONE_COMMIT_SHA; else git checkout -qf FETCH_HEAD; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the most portable way to compare strings in shell scripts is =
.
This is a workaround for a bug where GitHub asks Drone to build a branch that does not exist yet. We simply sleep for 5s before cloning to make sure the branch is created
cfc7ecd
to
2554a0f
Compare
- sleep 5s | ||
- git init | ||
- git remote add origin $DRONE_REMOTE_URL | ||
- git fetch --no-tags origin $DRONE_COMMIT_REF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is the merged PR branch reference, as it was before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolasstucki From the log:
+ git fetch --no-tags origin $DRONE_COMMIT_REF
From https://github.com/lampepfl/dotty
* branch refs/pull/3432/merge -> FETCH_HEAD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect :)
This is a workaround for a bug where GitHub asks Drone to build a branch
that does not exist yet. We simply sleep for 5s before cloning to make
sure the branch is created