The build-image action uses git rev-parse --short to calculate the SHA used for tagging the image.
According to the git documentation, the length of the SHA returned from this command is actually dynamic and depends on the number of packed objects in the repository. See the following:
This can result in different length SHAs over time as a repository grows.
Since it is not possible to override this value (at least according to the README), users cannot reliably control the expected SHA tag on the build without setting the git config for the runner.