Build.commit is not the same as BUILDKITE_COMMIT

When I manually trigger a build from the website the build.commit is not the same as BUILDKITE_COMMIT.

I encountered this problem because I am pushing to dockerhub and want to tag my image with my git commit. When this is manually triggered I end up with my-app:HEAD appearing on dockerhub. So I thought I could use the conditions to skip, but build.commit has the actual commit hash.

My pipeline comes my repo and so does buildkite-agent pipeline upload .buildkite/deploy.pipeline.yml

And deploy.pipeline.yml looks something like:

  - label: ":docker: Push"
    if: build.commit != "HEAD"
      - docker-compose#v3.1.0:
          config: docker/docker-compose.yml

Therefore it seems that pipeline upload updates the build.commit but not the BUILDKITE_COMMIT

Is there anything I can do?