Travis UI does not link a build to correct commit on GitHub PR

I ended up doing a “hard reset”: revocking all authorizations from GitHub to Travis, then adding them again:

GitHub > Settings > Applications > Authorized OAuth Apps

revoke Travis CI for Open Source.

Go to your Travis dashboard, log out, login again with GitHub and reauthorize.