Restore cache for Pull Request

Hello,

I know that Pull Requests do not create the cache, and when a pull request is created, it has to restore cache from another branch.

However, I’m having a problem that Drone always tries to restore cache from the master branch, even when the Pull Request is created for the develop branch. I have read the document about caching at http://readme.drone.io/usage/caching/ but I found no solution for the problem.
Are there any special configurations or any things that I have to do to make the cache work for Pull Requests which are created for other branches besides the master branch.

I’m using Drone 4.2 from the official Drone Docker Image in Docker Hub.

@wataridori drone will fallback to master branch if there is no cache for the current branch. There was an issue with 0.4 because it used the source branch for pull requests, and not the target branch (see https://github.com/drone/drone/issues/1367). This was resolved in 0.5

I know that Pull Requests do not create the cache, and when a pull request is created, it has to restore cache from another branch.

this restriction was removed in 0.5

1 Like