You can set it to not use the merge ref through an env var.
DRONE_GITHUB_MERGE_REF=true Set to true to use the refs/pulls/%d/merge vs refs/pulls/%d/head
I ran into two issues with the clone plugin using
pull/:id/merge as opposed to
pull/:id/head on a pull request with merge conflicts.
Drone pulls nexpected/stale code if merge conflict was introduced in the middle of a branch.
There was a merge conflict that was introduced, and the builds for a pull request started pulling from a stale piece of code (probably from before right the conflict).
git fetch --no-tags origin +refs/pull/2648/merge:
resulted in stale code.
git fetch --no-tags origin +refs/pull/2648/head:
resulted in the actual code in the PR, though there might be a merge conflict with the base branch.
This is annoying because instead of an explicit fail, it goes through the whole pipeline and deploys randomly old code into my feature branch testing servers.
Build failures for pull requests if there is a merge conflict to begin with
You’ll see something like this.
+ git fetch --no-tags origin +refs/pull/2648/merge: fatal: Couldn't find remote ref refs/pull/2648/merge