Skip to content

Commit

Permalink
Specify authors in post output by move-stable (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarcziova authored Jan 21, 2024
2 parents 66aa2d1 + b6553a9 commit 66b0968
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/move_stable.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import click
from copr.v3 import Client
from git import Repo
from git import Repo, GitConfigParser

import changelog

Expand Down Expand Up @@ -350,6 +350,15 @@ def create_blogpost(
title_text = f"Week {since_week_number}"
file_name = f"week-{since_week_number}.md"

try:
git_config_mail = GitConfigParser().get_value("user", "email")
author = git_config_mail.split("@")[0]
author_string = f"authors: {author}"
except Exception:
author_string = (
"# TODO replace <login> with your kerberos login\nauthors: <login>"
)

today = datetime.today()

click.echo(
Expand All @@ -359,6 +368,7 @@ def create_blogpost(
"---\n"
f"title: {title_text} in Packit\n"
f"date: {today.strftime('%Y-%m-%d')}\n"
f"{author_string}\n"
f"tags:\n"
f" - {since.year}-{since.strftime('%B')}\n"
f" - {since.year}\n"
Expand Down

0 comments on commit 66b0968

Please sign in to comment.