Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2024-03-22T01:46:46.430Z
Answers: 2024-03-22T02:26:13.040Z
Answers: 2024-03-22T02:26:13.040Z
Answers: Evan Carroll
Body: <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>
  
Tags: <gitlab><glab>
Title: How can I use `glab api` commands to configure settings that don't have a developed UI?
UserDisplayName: Evan Carroll
ThreadText: # 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 `username_0/foo` is,
  
  ```sh
  glab api "projects/username_0%2ffoo" \
    -X PUT \
    -f "ci_allow_fork_pipelines_to_run_in_parent_project=false"
  
  ```
  
  Note the project here is `username_0/foo` but you must url encode the `/` with `%2f`.
  
  
  ---
  
  