title: .gitlab-ci.yml can we capture response from curl then selectively run the followed stages?
body: <p>I need to selectively run stages in a single .gitlab-ci.yml file, while the selection is done by 1st stage for calling gitlab api.</p>
  
  <p>Below is the simplified code. Finally, only jobs 1, 3, 5, 7, 9 should happen in pipeline:-</p>
  
  <p><code>.gitlab-ci.yml</code> :</p>
  
  <pre><code>stages:
    - select
    - deploy
  
  select-targets:
    stage: select
    script:
      - curl "project_id=$CI_PROJECT_ID" -X POST https://some-api-endpoint
      - return some result e.g. [1, 3, 5, 7, 9]
  
  job1:
    stage: deploy
    script:
      - to deploy job 1
    only:
      - curl return has 1
  
  job2:
    stage: deploy
    script:
      - to deploy job 2
    only:
      - curl return has 2
  
  job3:
    stage: deploy
    script:
      - to deploy job 3
    only:
      - curl return has 3
  
  ... repeat for job 4 to job 9, now skipped for simplicity
  </code></pre>
  
  <p>Is this idea possible?</p>