---
title: "Access GitLab Resources in GitLab Runner Jobs"
date: 2022-01-13T15:16:22.000Z
author: Z.SHINCHVEN
tags: [GitLab Runner]
canonical: https://atlassc.net/2022/01/14/access-gitlab-resources-in-gitlab-runner-jobs
---
In complex CI/CD scenarios, we may need to access other resources from GitLab that is out of current project/repository,
like cloning another repository, or calling gitlab API to trigger a contiguous job.

These resources are accessible via [CI/CD job token](https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html).

## Clone a Repository Using CI_JOB_TOKEN

```bash
git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.example.com/<namespace>/<project>
```

## Trigger a Job Using CI_JOB_TOKEN

```bash
curl --request POST --form token=${CI_JOB_TOKEN} https://gitlab.example.com/api/v4/projects/<project_id>/trigger/pipeline
```
