danger-js icon indicating copy to clipboard operation
danger-js copied to clipboard

Improve GitLab CI support for MRs from forks

Open carburo opened this issue 6 years ago • 6 comments

Current GitLab CI provider gets the repoSlug from the environment variable CI_PROJECT_PATH, which by default points to the project from where the MR is created. This works fine for MRs coming from the same project, but not for MRs coming from forks. Starting on Gitlab 11.6 there is CI_MERGE_REQUEST_PROJECT_PATH environment variable that works for both cases.

carburo avatar Jan 24 '20 16:01 carburo

Great - would be good to get a test for this, but other than that - looks perfect. Thanks!

orta avatar Jan 24 '20 16:01 orta

Yes, sorry about that! I'll add a test. Thank you!

carburo avatar Jan 24 '20 17:01 carburo

Ja, tut mir leid! Ich füge einen Test hinzu. Vielen Dank!

Jimimaku avatar Nov 21 '22 21:11 Jimimaku

Jimimaku avatar Nov 21 '22 21:11 Jimimaku

Der aktuelle GitLab CI-Anbieter ruft den repoSlug aus der Umgebungsvariablen ab, die standardmäßig auf das Projekt verweist, aus dem der MR erstellt wird. Dies funktioniert gut für MRs, die aus demselben Projekt stammen, aber nicht für MRs, die von Forks kommen. Ab Gitlab 11.6 gibt esCI_MERGE_REQUEST_PROJECT_PATHUmgebungsvariable, die für beide Fälle funktioniert.CI_PROJECT_PATH

Jimimaku avatar Nov 21 '22 21:11 Jimimaku

Merge without tests then?

glensc avatar Feb 07 '23 23:02 glensc