Skip to content

Commit fa95dde

Browse files
fix: reduce whitespace in slack changelogs
1 parent 32fa9d1 commit fa95dde

File tree

1 file changed

+1
-9
lines changed
  • .github/actions/publish-changelog-to-slack

1 file changed

+1
-9
lines changed

.github/actions/publish-changelog-to-slack/publish.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ class Changelog(TypedDict):
3535
deduplicated_groups: list[list[ChangeEntry]]
3636

3737

38-
SPACER = {"type": "context", "elements": [{"type": "plain_text", "text": " "}]}
39-
DIVIDER = {"type": "divider"}
4038

4139

4240
def build_change_list_elements(
@@ -105,7 +103,6 @@ def build_slack_blocks(changelog: Changelog, title: str, repository: str) -> lis
105103
has_dropped = any(changelog["dropped_changes"].values())
106104

107105
blocks: list[dict] = [
108-
DIVIDER,
109106
{
110107
"type": "header",
111108
"text": {"type": "plain_text", "text": title, "emoji": True},
@@ -122,18 +119,15 @@ def build_slack_blocks(changelog: Changelog, title: str, repository: str) -> lis
122119
}
123120
)
124121

125-
blocks.extend([SPACER, DIVIDER])
122+
blocks.append({"type": "divider"})
126123

127124
if not has_changes and not has_dropped:
128125
blocks.extend(
129126
[
130-
SPACER,
131127
{
132128
"type": "section",
133129
"text": {"type": "mrkdwn", "text": "_no changes in this release_"},
134130
},
135-
SPACER,
136-
DIVIDER,
137131
]
138132
)
139133
return blocks
@@ -152,7 +146,6 @@ def build_slack_blocks(changelog: Changelog, title: str, repository: str) -> lis
152146
for category, changes in changelog["new_changes"].items():
153147
if changes:
154148
blocks.append(build_changes_block(category, changes, repository))
155-
blocks.extend([SPACER, DIVIDER])
156149

157150
if has_dropped:
158151
blocks.append(
@@ -168,7 +161,6 @@ def build_slack_blocks(changelog: Changelog, title: str, repository: str) -> lis
168161
for category, changes in changelog["dropped_changes"].items():
169162
if changes:
170163
blocks.append(build_changes_block(category, changes, repository))
171-
blocks.extend([SPACER, DIVIDER])
172164

173165
return blocks
174166

0 commit comments

Comments
 (0)