Save one of the last spots in our Shell + Git + GitLab introdoctury course on Friday and Monday next week. 👉 Register here.

Verified Commit 9df88451 authored by Huste, Tobias (FWCC) - 111645's avatar Huste, Tobias (FWCC) - 111645
Browse files

utils: extract contributors from gitlab api

parent 02fc68dc
Pipeline #8644 failed with stage
in 4 minutes and 3 seconds
......@@ -41,3 +41,18 @@ def parse_timestamp(x):
if dt.tzinfo is None:
dt = dt.replace(tzinfo=pytz.utc)
return dt
def get_contributors(gl, project_id):
"""Return contributors of GitLab project."""
try:
contributors = []
for contributor in project.repository_contributors(as_list=False):
if contributor['name']:
contributors.append(dict(
name=contributor['name'],
affiliation='',
))
return contributors
except Exception:
return None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment