Skip to content

Commit

Permalink
Update forum poster (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
cidrblock authored Jul 24, 2024
1 parent 6ae2fdb commit f4a2c0f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/forum_post.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cspell:ignore devcontainer
"""A forum poster."""

import argparse
Expand All @@ -9,7 +10,7 @@

POST_MD = """Hello everyone,
We are happy to announce the release of {project} {release}.
We are happy to announce the release of {project_short} {release}.
# How to get it
Expand Down Expand Up @@ -47,11 +48,11 @@
Sample `devcontainer.json` files are available in the [ansible-dev-tools](https://github.com/ansible/ansible-dev-tools/tree/main/.devcontainer) repository.
# Release notes for {project} {release}
# Release notes for {project_short} {release}
{release_notes}
Release notes for all versions can be found in the [changelog](https://github.com/ansible/{project}/releases).
Release notes for all versions can be found in the [changelog](https://github.com/ansible/{project_short}/releases).
""" # noqa: E501

Expand All @@ -73,9 +74,9 @@ def __init__(self, project: str, release: str, forum_api_key: str, forum_user: s
self.forum_api_key = forum_api_key
self.forum_user = forum_user
self.project = project
self.project_short = project.split("/")[-1]
self.release = release
self.release_notes: str
self.user = "ansible-announce"

def _get_release_notes(self) -> None:
"""Get the release notes for the project."""
Expand Down Expand Up @@ -104,11 +105,11 @@ def post(self) -> None:
self._get_release_notes()
self._get_category_id()
post_md = POST_MD.format(
project=self.project,
project_short=self.project_short,
release=self.release,
release_notes=self.release_notes,
)
title = f"Release Announcement: {self.project} {self.release}"
title = f"Release Announcement: {self.project_short} {self.release}"

payload = {
"title": title,
Expand Down

0 comments on commit f4a2c0f

Please sign in to comment.