Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
See merge request gitlab-org/gitlab-ee!4753