Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 127 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,45 +147,138 @@ jobs:
shell: pwsh
run: |
Write-Output "DEBUG: Starting parse_commit"
$commitMsg = git log -1 --pretty=%B
Write-Output "DEBUG: Commit message: $commitMsg"

$commitSubject = $commitMsg.Split("`n")[0]
$commitBodyLines = $commitMsg.Split("`n") | Select-Object -Skip 1
$commitBody = ($commitBodyLines -join "`n").Trim()

$releaseNotes = "## Changes`n`n"

if ($commitSubject -match '^(fix|feat|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?:\s*(.+)$') {
$type = $Matches[1]
$description = $Matches[3]
$typeLabel = switch ($type) {
'fix' { 'πŸ› Fix' }
'feat' { '✨ Feature' }
'refactor' { '♻️ Refactor' }
'test' { 'βœ… Test' }
'chore' { 'πŸ”§ Chore' }
'perf' { '⚑ Performance' }
'build' { 'πŸ“¦ Build' }
'revert' { 'βͺ Revert' }
default { 'πŸ“ Update' }
# Get all commits from the PR (base to head)
$baseSha = "${{ github.event.pull_request.base.sha }}"
$headSha = "${{ github.event.pull_request.head.sha }}"

Write-Output "DEBUG: Base SHA: $baseSha"
Write-Output "DEBUG: Head SHA: $headSha"

# Get all commit messages in the PR
$commits = @(git log --pretty=format:"%h|%s|%b" "$baseSha..$headSha")
Write-Output "DEBUG: Found $($commits.Count) commits in PR"

# Initialize categorized lists
$features = @()
$fixes = @()
$performance = @()
$refactors = @()
$docs = @()
$tests = @()
$chores = @()
$builds = @()
$ci = @()
$style = @()
$reverts = @()
$others = @()

# Parse each commit
foreach ($line in $commits) {
if ([string]::IsNullOrWhiteSpace($line)) { continue }

$parts = $line -split '\|', 3
if ($parts.Count -lt 2) { continue }

$commitHash = $parts[0]
$subject = $parts[1]
$body = if ($parts.Count -eq 3) { $parts[2] } else { "" }

Write-Output "DEBUG: Processing commit $commitHash : $subject"

# Parse conventional commit format
if ($subject -match '^(fix|feat|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?:\s*(.+)$') {
$type = $Matches[1]
$scope = if ($Matches[2]) { $Matches[2] } else { "" }
$description = $Matches[3]

$entry = "- $description ($commitHash)"

switch ($type) {
'feat' { $features += $entry }
'fix' { $fixes += $entry }
'perf' { $performance += $entry }
'refactor' { $refactors += $entry }
'docs' { $docs += $entry }
'test' { $tests += $entry }
'chore' { $chores += $entry }
'build' { $builds += $entry }
'ci' { $ci += $entry }
'style' { $style += $entry }
'revert' { $reverts += $entry }
default { $others += "- $subject ($commitHash)" }
}
} else {
# Non-conventional commit
$others += "- $subject ($commitHash)"
}
$releaseNotes += "**$typeLabel**: $description`n"
} else {
$releaseNotes += "$commitSubject`n"
}

if ($commitBody -ne "") {
$maxBodyLength = 1000
if ($commitBody.Length -gt $maxBodyLength) {
$commitBody = $commitBody.Substring(0, $maxBodyLength) + "..."
}
$releaseNotes += "`n$commitBody`n"
# Build release notes
$releaseNotes = "## Changes`n`n"

if ($features.Count -gt 0) {
$releaseNotes += "### ✨ Features`n"
$releaseNotes += ($features -join "`n") + "`n`n"
}


if ($fixes.Count -gt 0) {
$releaseNotes += "### πŸ› Fixes`n"
$releaseNotes += ($fixes -join "`n") + "`n`n"
}

if ($performance.Count -gt 0) {
$releaseNotes += "### ⚑ Performance`n"
$releaseNotes += ($performance -join "`n") + "`n`n"
}

if ($refactors.Count -gt 0) {
$releaseNotes += "### ♻️ Refactoring`n"
$releaseNotes += ($refactors -join "`n") + "`n`n"
}

if ($docs.Count -gt 0) {
$releaseNotes += "### πŸ“ Documentation`n"
$releaseNotes += ($docs -join "`n") + "`n`n"
}

if ($tests.Count -gt 0) {
$releaseNotes += "### βœ… Tests`n"
$releaseNotes += ($tests -join "`n") + "`n`n"
}

if ($builds.Count -gt 0) {
$releaseNotes += "### πŸ“¦ Build`n"
$releaseNotes += ($builds -join "`n") + "`n`n"
}

if ($chores.Count -gt 0) {
$releaseNotes += "### πŸ”§ Chores`n"
$releaseNotes += ($chores -join "`n") + "`n`n"
}

if ($ci.Count -gt 0) {
$releaseNotes += "### πŸ”„ CI/CD`n"
$releaseNotes += ($ci -join "`n") + "`n`n"
}

if ($style.Count -gt 0) {
$releaseNotes += "### πŸ’„ Style`n"
Copy link
Owner

@supervoidcoder supervoidcoder Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$releaseNotes += "### πŸ’„ Style`n"
$releaseNotes += "### 🎨 Style`n"

the lipstick emoji ticks me off lolllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai which other emojis you suggest for style?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@supervoidcoder, here are some popular emoji alternatives for the Style category:

Most Common Choice:

  • 🎨 :art: - Artist Palette - This is the standard in gitmoji and widely used for formatting/style changes

Other Good Options:

  • 🧹 :broom: - Broom (your suggestion!) - Great for "cleaning up" code
  • πŸ–ŒοΈ :paintbrush: - Paintbrush - Similar vibe to the palette
  • πŸ“ :triangular_ruler: - Triangular Ruler - Emphasizes alignment/formatting
  • πŸ“ :straight_ruler: - Straight Ruler - Also works for formatting
  • 🧼 :soap: - Soap - Cleaning/tidying up code

My recommendation: Go with 🎨 (artist palette) as it's the most recognized in the developer community for style/formatting commits, or stick with your 🧹 (broom) suggestion if you prefer the "cleaning up code" metaphor!

🐰✨


🧠 Learnings used
Learnt from: supervoidcoder
Repo: supervoidcoder/win-witr PR: 48
File: README.md:38-38
Timestamp: 2026-01-21T01:52:33.870Z
Learning: For supervoidcoder's README files in the win-witr repository: The user prefers an intentionally informal, humorous tone with casual language. Grammar formality suggestions (like "anyways" vs "anyway") should be skipped as they don't align with the intentional style of the documentation.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok great i did the palette

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@supervoidcoder Awesome! 🎨 is a solid choice – it's the standard for style/formatting changes across the dev community. Your release notes will look great!

🐰✨


🧠 Learnings used
Learnt from: supervoidcoder
Repo: supervoidcoder/win-witr PR: 48
File: README.md:38-38
Timestamp: 2026-01-21T01:52:33.870Z
Learning: For supervoidcoder's README files in the win-witr repository: The user prefers an intentionally informal, humorous tone with casual language. Grammar formality suggestions (like "anyways" vs "anyway") should be skipped as they don't align with the intentional style of the documentation.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

$releaseNotes += ($style -join "`n") + "`n`n"
}

if ($reverts.Count -gt 0) {
$releaseNotes += "### βͺ Reverts`n"
$releaseNotes += ($reverts -join "`n") + "`n`n"
}

if ($others.Count -gt 0) {
$releaseNotes += "### πŸ“‹ Other Changes`n"
$releaseNotes += ($others -join "`n") + "`n`n"
}

Write-Output "DEBUG: releaseNotes: $releaseNotes"
$commitSha = git rev-parse --short HEAD
$releaseNotes += "`n---`n*Commit: $commitSha*"
$releaseNotes += "---`n*Based on commits from $baseSha to $headSha*"

$delimiter = "EOF_$(Get-Random)"
Write-Output "DEBUG: Writing notes to output using delimiter $delimiter"
Expand Down