Skip to content

Commit 2554a0f

Browse files
committed
Fix #3415: Spurious clone failures in CI
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
1 parent c8411af commit 2554a0f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.drone.yml

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# We override the default clone step to workaround a bug with GitHub (see #3415)
2+
clone:
3+
custom:
4+
image: plugins/git
5+
commands:
6+
- sleep 5s
7+
- git init
8+
- git remote add origin $DRONE_REMOTE_URL
9+
- git fetch --no-tags origin $DRONE_COMMIT_REF
10+
- if [ $DRONE_BUILD_EVENT = "push" ]; then git reset --hard -q $DRONE_COMMIT_SHA; else git checkout -qf FETCH_HEAD; fi
11+
- git submodule update --init --recursive
12+
113
pipeline:
214
# TESTS:
315
# We run tests in parallel. Tests run in a copy of the working directory to avoid conflict

0 commit comments

Comments
 (0)