Validate deployment SHAs and refs
What does this MR do?
This prevents users from creating deployments using the API while providing an invalid SHA or ref name. Providing invalid data for these fields will break certain parts of GitLab, such as the UI used for displaying the deployments of an environment.
This fixes #36967 (closed)