only:changes doesn't work correctly for external pull requests

Summary

only:changes/except:changes when used with only: external_pull_requests always evaluates to true.

Steps to reproduce

  1. Create a job with only block below in new PR without Dockerfile changes. (Job will run, but shouldn't)
  2. Push commit without matching changes to PR (Job will run again, but shouldn't)
only:
  refs:
    - external_pull_requests
  changes:
    - Dockerfile

What is the current bug behavior?

only:changes/except:changes always evaluates to true when used with only:external_pull_requests

What is the expected correct behavior?

only:changes/except:changes should work the same for only:external_pull_requests as it does for only: merge_requests