def gh_event_push(db, repo, payload, actor):
"""Process GitHub PushEvent (with commits)
https://developer.github.com/v3/activity/events/types/#pushevent
:param db: Database to store push data
:type db: ``flask_sqlalchemy.SQLAlchemy``
:param repo: Repository where push belongs to
:type repo: ``repocribro.models.Repository``
:param payload: Data about push and commits
:type payload: dict
:param actor: Actor doing the event
:type actor: dict
"""
push = Push.create_from_dict(payload, actor, repo)
db.session.add(push)
for commit in push.commits:
db.session.add(commit)
评论列表
文章目录