Respect `needs:` for artifacts dependencies
What does this MR do?
When needs:
is defined, the value of it is
not respected when returning a list of artifacts
to the runner from the job.
Does this MR meet the acceptance criteria?
Conformity
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65466
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/65457
Edited by Kamil Trzciński (Back 2025-01-01)