0

How do I list all the changed files in a MR via Gitlab API? I'm working in a CI project and just want to build the necessary code!

Taison Morris
  • 878
  • 1
  • 8
  • 12

1 Answers1

1

You have all the information you need in GitLab's documentation

Specifically, this is an example of response:

{
  "id": 21,
...
  "changes": [
    {
    "old_path": "VERSION",
    "new_path": "VERSION",
    "a_mode": "100644",
    "b_mode": "100644",
    "diff": "--- a/VERSION\ +++ b/VERSION\ @@ -1 +1 @@\ -1.9.7\ +1.9.8",
    "new_file": false,
    "renamed_file": false,
    "deleted_file": false
    }
  ]
}

You can extract the file names from changes -> new_path

Aviad Levy
  • 750
  • 4
  • 13