Get all pipelines run for a specific commit using GitLab CI/CD API

Replace this template with your information

I am trying to use the REST API to get a list of pipelines that were run for a specific commit.
For the GitLab web interface i can go to a specific commit and see the list of pipelines that were run:
image
I would expect something similar is possible using the API but i cannot manage to get a list of pipelines. The best i could do is get the latest pipeline that was run for a commit which is not enough for me.

The alternative i have is to list all latest pipelines and go one by one, for each pipeline looking at one of the job and find there commit information, then filter-out the pipeline i’m not interested in. Which is not efficient at all.

A parameter to “GET /projects/:id/pipelines” such as commit_sha would be tremendous…

Thanks

1 Like

I would also like this functionality. Did you ever work out a better way to do this?