Skip to content

Commit 4d691ad

Browse files
committed
feat: commiter -> author to avoid returning Github as author
1 parent 17fafb6 commit 4d691ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nonebot_plugin_github_release_notifier/repo_activity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def notify(
165165
elif "published_at" in item:
166166
times = item["published_at"].replace("Z", "+00:00")
167167
else:
168-
times = item["commit"]["committer"]["date"].replace("Z", "+00:00")
168+
times = item["commit"]["author"]["date"].replace("Z", "+00:00")
169169
item_time = datetime.fromisoformat(times)
170170
last_time = load_last_processed().get(repo, {}).get(data_type)
171171
if (
@@ -192,7 +192,7 @@ async def notify(
192192
elif "published_at" in latest_data[0]:
193193
times = latest_data[0]["published_at"].replace("Z", "+00:00")
194194
else:
195-
times = latest_data[0]["commit"]["committer"]["date"]
195+
times = latest_data[0]["commit"]["author"]["date"]
196196
times = times.replace("Z", "+00:00")
197197

198198
# Update the last processed time
@@ -205,9 +205,9 @@ def format_message(repo: str, item: dict, data_type: str) -> str:
205205
datas = {
206206
"repo": repo,
207207
"message": item["commit"]["message"],
208-
"author": item["commit"]["committer"]["name"],
208+
"author": item["commit"]["author"]["name"],
209209
"url": item["html_url"],
210-
"time": item["commit"]["committer"]["date"],
210+
"time": item["commit"]["author"]["date"],
211211
}
212212
elif data_type == "issue":
213213
datas = {

0 commit comments

Comments
 (0)