This is a manual backport of !30934 (merged)
#216345
https://gitlab.com/gitlab-org/release/tasks/-/issues/1319