How to list in-progress pipelines for a given project

Introduction:

If you need to find out which pipelines are in-progress without using the UI, you'll find that unlike jobs and workflows, pipelines never have a "running" status.

For pipelines, the possible statuses (returned by the API v2) are: "created" "errored" "setup-pending" "setup" "pending".

However, we can deduce/consider that a given pipeline is in progress if any of the elements (workflows/jobs) it contains are in a "running" state.

 

Prerequisites (If Applicable):

If you don't already have one that you can use, you'll need to generate a personal API token to authenticate your requests to the CircleCI API v2.

Instructions:

  1.  Get the list of all pipelines for the project
  2. Check the statuses of the workflow(s) for each pipeline

Outcome:

If for a given pipeline there is [are] a "running" workflow[s], then note/save the pipeline ID; the related pipeline is considered in-progress.

 

Additional Resources:

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.