<p>The right syntax to set this attribute for a project <code>evancarroll/foo</code> is,</p>
<pre class="lang-sh prettyprint-override"><code>glab api &quot;projects/evancarroll%2ffoo&quot; \
  -X PUT \
  -f &quot;ci_allow_fork_pipelines_to_run_in_parent_project=false&quot;
</code></pre>
<p>Note the project here is <code>evancarroll/foo</code> but you must url encode the <code>/</code> with <code>%2f</code>.</p>

CC BY-SA 4.0
2024-03-22T01:46:46.430Z
2024-03-22T02:26:13.040Z
2024-03-22T02:26:13.040Z
Evan Carroll
<p>According to the <a href="https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#prerequisites" rel="nofollow noreferrer">documentation on Merge Request Pipelines</a>,</p>
<blockquote>
<p>To prevent users from running new pipelines for fork projects in the parent project use <a href="https://docs.gitlab.com/ee/api/projects.html#edit-project" rel="nofollow noreferrer">the projects API</a> to disable the <code>ci_allow_fork_pipelines_to_run_in_parent_project</code> setting.</p>
<blockquote>
<p>Pipelines created before the setting was disabled are not affected and continue to run. If you rerun a job in an older pipeline, the job uses the same context as when the pipeline was originally created.</p>
</blockquote>
</blockquote>
<p>How can I do that with glab? There is no example of setting REST parameters <code>glab api --help</code>.</p>

<gitlab><glab>
How can I use `glab api` commands to configure settings that don't have a developed UI?
Evan Carroll
# How can I use `glab api` commands to configure settings that don't have a developed UI?

(Asked by: username_0 on 2024-03-22)

According to the [documentation on Merge Request Pipelines](https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#prerequisites),

> To prevent users from running new pipelines for fork projects in the parent project use [the projects API](https://docs.gitlab.com/ee/api/projects.html#edit-project) to disable the `ci_allow_fork_pipelines_to_run_in_parent_project` setting.
>
> > Pipelines created before the setting was disabled are not affected and continue to run. If you rerun a job in an older pipeline, the job uses the same context as when the pipeline was originally created.

How can I do that with glab? There is no example of setting REST parameters `glab api --help`.

**Tags:** gitlab, glab


---

## 1 answers

### Answer by username_0 on 2024-03-22. Score: 0 | Accepted answer

The right syntax to set this attribute for a project evancarroll/foo is,
glab api "projects/evancarroll%2ffoo" \
  -X PUT \
  -f "ci_allow_fork_pipelines_to_run_in_parent_project=false"

Note the project here is evancarroll/foo but you must url encode the / with %2f.


---

