Pipeline triggered by creating a Merge Request via API with a Project Access Token fails when gitlab-ci.yml includes templates from other projects

Reproduction:

  1. Create private Projects A and B
  2. In Project A, add a template gitlab-ci.yml file
  3. In Project B, create a gitlab-ci.yml file that includes the template from Project A and create a job that builds merge requests with a job from that template
  4. In Project B, create a Project Access Token
  5. Create a merge request in Project B via the API using the Project Access Token

Expected Result: The pipeline should be able to run

Actual Result: The pipeline fails because the Project Access Token does not have permission to access the template from Project A

Considered Alternatives:

I considered using Deploy Tokens instead and create a merge request while doing a push, but that is limited because it does not allow line-breaks in merge request descriptions and does not allow to add reviewers to the merge request.