Not being able to include gitlab-ci template from private project

Hello and good day.

I would like to be able to include a template gitlab-ci file in project A which is located in another private project B. I am including the file via

    remote: "https://gitlab-ci-token:$"

I went into the CI/CD settings in project B and gave the CI_JOB_TOKEN of project A access to project B.

Still I am getting the error:

  • Remote file could not be fetched because of HTTP code 403 error!

Is there a simple way to access files for a repo directly via HTTP GET with Basic Auth wich works in this case?

Thank you

Hi @sebmezza

If it’s on the same GitLab instance you can just use:

- project: 'group/templates/project-b'
  file: '/.gitlab-ci-spring-boot-template.yml'
1 Like

Thank you sooo much @balonik ,

I probably overread that in the documentation and it solved my problem and the builds are working like a charm. Thank you again and have a great day!