ehsan-dashboards/dashboards/get_commit_diff.py

9 lines
288 B
Python

import requests
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
r = requests.get('https://gitlab.ekeepa.co/api/v4/projects/10/repository/commits/2da96902/diff', headers=headers)
for diff in r.json():
print(diff['new_path'])
print(diff['diff'])