Search code examples
gitlabgitlab-cigitlab-ci-runner

How to update GitLab CI/CD variables after repository name change?


I have recently changed my repository name in GitLab. Is there any way I can make sure that the stock GitLab CI/CD variables are updated to reflect the new repository name without manually overriding them in my CI/CD pipelines?

Hypothetically, lets say the repository's original name is 'A' and its new name is 'B'. Once I've changed the repository's name, the GitLab CI/CD variables that are set automatically by GitLab remain unchanged. For example the stock CI/CD variable CI_PROJECT_NAME is still A when I want it to now be B to reflect the new repository name.


Solution

  • According to the docs, the variable CI_PROJECT_NAME is derived from the directory of the project. This can be changed under Settings -> General -> Avanced -> Change path. After editing the project path here, CI_PROJECT_NAME changes its value accordingly.

    In your case I would blindly guess that you just changed the project name under Settings -> General -> Project name, which is only used for displaying in the UI.