Stale files issue when running a step

I’m running into a strange issue: GitHub PR sends a webhook to Drone, Drone starts building it, however, one of the bash scripts that I’m using appears to be from 10 commits ago.

Observations:

  • .drone.yml file gets read correctly - e.g. any changes I make are immediately reflected
  • if I run ‘cat’ against the file I’m trying to run, it shows me its old version
  • if I rename bash file and update .drone.yml drone fails with ‘file not found error’

I’m running Drone on K8s using Helm chart.

Any suggestions on how I might fix it? Where does it store its cache?

I’m running into a strange issue: GitHub PR sends a webhook to Drone, Drone starts building it, however, one of the bash scripts that I’m using appears to be from 10 commits ago.

Drone uses the github merge ref to clone your code. If the merge ref is cloning unexpected or stale files you might want to contact github support. Alternatively you can configure your drone instance to use the base ref instead of the merge ref by setting DRONE_GITHUB_MERGE_REF=false

Thanks Brad, appreciate quick reply. I went through clone steps locally and lo and behold - stale file is there. It’s likely was due to me doing some rebases and having merge conflicts that caused PR to break.

Thanks for your help, I’ll keep in mind to have the env var handy.