⚗️ add deployed event

Fix QQ-GITHUB-BOT-1V
This commit is contained in:
yanyongyu 2021-08-20 23:28:24 +08:00
parent 6ec3e7a1e3
commit 5a95e809a1
4 changed files with 64 additions and 9 deletions

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-11 16:57:04
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 01:11:35
@LastEditTime : 2021-08-20 23:24:08
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -27,10 +27,10 @@ from .timeline import (
TimelineEventSubscribed, TimelineEventUnsubscribed, TimelineEventReviewed,
TimelineEventReviewRequested, TimelineEventReviewRemoved,
TimelineEventReviewDismissed, TimelineEventRenamed, TimelineEventLabeled,
TimelineEventUnlabeled, TimelineEventMerged, TimelineEventClosed,
TimelineEventAddedToProject, TimelineEventMovedColumnsInProject,
TimelineEventRemovedFromProject, TimelineEventMilestoned,
TimelineEventDemilestoned)
TimelineEventUnlabeled, TimelineEventMerged, TimelineEventDeployed,
TimelineEventClosed, TimelineEventAddedToProject,
TimelineEventMovedColumnsInProject, TimelineEventRemovedFromProject,
TimelineEventMilestoned, TimelineEventDemilestoned)
class IssuePullRequest(_BaseModel):
@ -107,8 +107,8 @@ class Issue(BaseModel):
TimelineEventReviewRequested, TimelineEventReviewRemoved,
TimelineEventReviewDismissed, TimelineEventRenamed,
TimelineEventLabeled, TimelineEventUnlabeled,
TimelineEventMerged, TimelineEventClosed,
TimelineEventAddedToProject,
TimelineEventMerged, TimelineEventDeployed,
TimelineEventClosed, TimelineEventAddedToProject,
TimelineEventMovedColumnsInProject,
TimelineEventRemovedFromProject, TimelineEventMilestoned,
TimelineEventDemilestoned, TimelineEvent],

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-05-14 00:57:33
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 01:15:57
@LastEditTime : 2021-08-20 23:23:33
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -301,6 +301,18 @@ class TimelineEventMerged(TimelineEvent):
created_at: datetime
# Pull Request Deployed
class TimelineEventDeployed(TimelineEvent):
type: Literal["deployed"]
id: int
node_id: str
url: str
actor: Actor
commit_id: Optional[str]
commit_url: Optional[str]
created_at: datetime
# Issue Closed
class TimelineEventClosed(TimelineEvent):
event: Literal["closed"]

View File

@ -0,0 +1,40 @@
<!--
* @Author : yanyongyu
* @Date : 2021-08-20 23:26:14
* @LastEditors : yanyongyu
* @LastEditTime : 2021-08-20 23:27:45
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
<div class="TimelineItem">
<div class="TimelineItem-badge">
<svg
aria-hidden="true"
height="16"
viewBox="0 0 16 16"
version="1.1"
width="16"
data-view-component="true"
class="octicon octicon-rocket"
>
<path
fill-rule="evenodd"
d="M14.064 0a8.75 8.75 0 00-6.187 2.563l-.459.458c-.314.314-.616.641-.904.979H3.31a1.75 1.75 0 00-1.49.833L.11 7.607a.75.75 0 00.418 1.11l3.102.954c.037.051.079.1.124.145l2.429 2.428c.046.046.094.088.145.125l.954 3.102a.75.75 0 001.11.418l2.774-1.707a1.75 1.75 0 00.833-1.49V9.485c.338-.288.665-.59.979-.904l.458-.459A8.75 8.75 0 0016 1.936V1.75A1.75 1.75 0 0014.25 0h-.186zM10.5 10.625c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 00.119-.213v-2.066zM3.678 8.116L5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 00-.213.119l-1.2 1.95 1.782.547zm5.26-4.493A7.25 7.25 0 0114.063 1.5h.186a.25.25 0 01.25.25v.186a7.25 7.25 0 01-2.123 5.127l-.459.458a15.21 15.21 0 01-2.499 2.02l-2.317 1.5-2.143-2.143 1.5-2.317a15.25 15.25 0 012.02-2.5l.458-.458h.002zM12 5a1 1 0 11-2 0 1 1 0 012 0zm-8.44 9.56a1.5 1.5 0 10-2.12-2.12c-.734.73-1.047 2.332-1.15 3.003a.23.23 0 00.265.265c.671-.103 2.273-.416 3.005-1.148z"
></path>
</svg>
</div>
<div class="TimelineItem-body">
<a>
<img
class="avatar avatar-user"
height="20"
width="20"
src="{{ event.actor.avatar_url }}"
/>
</a>
<a class="author Link--primary text-bold">{{ event.actor.login|escape }}</a>
deployed this
<a class="Link--secondary">{{ event.created_at|relative_time }}</a>
</div>
</div>

View File

@ -2,7 +2,7 @@
* @Author : yanyongyu
* @Date : 2021-05-14 17:11:26
* @LastEditors : yanyongyu
* @LastEditTime : 2021-08-20 00:53:29
* @LastEditTime : 2021-08-20 23:25:47
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
@ -69,6 +69,9 @@
{% elif event|classname == "TimelineEventUnlabeled" -%}
{% include "unlabel.html" %}
{% elif event|classname == "TimelineEventDeployed" -%}
{% include "deployed.html" %}
{% elif event|classname == "TimelineEventAddedToProject" -%}
{% include "add-to-project.html" %}