Merge branch 'add-changed-files' of https://github.com/mrstanwell/buildbot-gitea into mrstanwell-add-changed-files

This commit is contained in:
Marvin Pohl 2021-03-20 12:25:05 +01:00
commit e2297f3be7

View File

@ -36,10 +36,14 @@ class GiteaHandler(BaseHookHandler):
commits = commits[:1] commits = commits[:1]
for commit in commits: for commit in commits:
files = []
for kind in ('added', 'modified', 'removed'):
files.extend(commit.get(kind, []))
timestamp = dateparse(commit['timestamp']) timestamp = dateparse(commit['timestamp'])
change = { change = {
'author': '{} <{}>'.format(commit['author']['name'], 'author': '{} <{}>'.format(commit['author']['name'],
commit['author']['email']), commit['author']['email']),
'files': files,
'comments': commit['message'], 'comments': commit['message'],
'revision': commit['id'], 'revision': commit['id'],
'when_timestamp': timestamp, 'when_timestamp': timestamp,