Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer committed Jan 9, 2025
1 parent 516baba commit 9092567
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,22 @@ jobs:
release = response.json()
changelog = release.get('body', '')
# Extract only the "What's Changed" section
match = re.search(r"## What's Changed(.*?)(##|$)", changelog, flags=re.DOTALL)
if match:
changelog = match.group(1).strip()
else:
changelog = "Bug fixes and performance improvements."
# Remove all Markdown formatting
changelog = re.sub(r'^#+\s*', '', changelog, flags=re.MULTILINE) # Remove all headers
changelog = re.sub(r'^#+\s*', '', changelog, flags=re.MULTILINE) # Remove headers
changelog = re.sub(r'\*\*|__|\*|_', '', changelog) # Remove bold, italics, etc.
changelog = re.sub(r'\[(.*?)\]\((.*?)\)', r'\1', changelog) # Remove links but keep text
changelog = re.sub(r'^Full Changelog:.*$', '', changelog, flags=re.MULTILINE) # Remove specific line
changelog = re.sub(r'https://github\.com/[^/]+/[^/]+/pull/(\d+)', r'#\1', changelog) # Shorten pull request URLs
# Remove excess blank lines
changelog = re.sub(r'\n\s*\n', '\n', changelog).strip()
# Write cleaned changelog to GITHUB_OUTPUT
with open(os.environ['GITHUB_OUTPUT'], 'a') as output_file:
output_file.write(f"changelog<<EOF\n{changelog}\nEOF\n")
Expand Down

0 comments on commit 9092567

Please sign in to comment.