Skip to content

Commit 66b0968

Browse files
authored
Specify authors in post output by move-stable (#550)
2 parents 66aa2d1 + b6553a9 commit 66b0968

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/move_stable.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import click
1414
from copr.v3 import Client
15-
from git import Repo
15+
from git import Repo, GitConfigParser
1616

1717
import changelog
1818

@@ -350,6 +350,15 @@ def create_blogpost(
350350
title_text = f"Week {since_week_number}"
351351
file_name = f"week-{since_week_number}.md"
352352

353+
try:
354+
git_config_mail = GitConfigParser().get_value("user", "email")
355+
author = git_config_mail.split("@")[0]
356+
author_string = f"authors: {author}"
357+
except Exception:
358+
author_string = (
359+
"# TODO replace <login> with your kerberos login\nauthors: <login>"
360+
)
361+
353362
today = datetime.today()
354363

355364
click.echo(
@@ -359,6 +368,7 @@ def create_blogpost(
359368
"---\n"
360369
f"title: {title_text} in Packit\n"
361370
f"date: {today.strftime('%Y-%m-%d')}\n"
371+
f"{author_string}\n"
362372
f"tags:\n"
363373
f" - {since.year}-{since.strftime('%B')}\n"
364374
f" - {since.year}\n"

0 commit comments

Comments
 (0)