Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve CI_SERVER_URL as GITLAB_URL? #720

Open
huxuan opened this issue May 17, 2024 · 1 comment
Open

Retrieve CI_SERVER_URL as GITLAB_URL? #720

huxuan opened this issue May 17, 2024 · 1 comment

Comments

@huxuan
Copy link

huxuan commented May 17, 2024

According to the Predefined CI/CD variables reference, CI_SERVER_URL will just be what we want to GITLAB_URL, so when we are running on GitLab CI/CD, maybe it is better to retrieve the value by default?

@fgreinacher
Copy link
Contributor

Thanks for reaching out! We do already have some logic to determine the default GitLab URL:

const defaultedGitlabUrl =
userGitlabUrl ||
(service === "gitlab" && CI_PROJECT_URL && CI_PROJECT_PATH
? CI_PROJECT_URL.replace(new RegExp(`/${CI_PROJECT_PATH}$`), "")
: "https://gitlab.com");

I agree that using CI_SERVER_URL would probably simplify this a bit as we would not need the project URL/path logic anymore.

Feel free to send a pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants