From 3adbdc418279f77d2a281bdbaebe9de10a98a105 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:17:37 +0000 Subject: [PATCH 1/4] Initial plan From 28322a7312eaf56c7afc9f992a13a00a596be2cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:19:41 +0000 Subject: [PATCH 2/4] fix: parse all PR commits instead of just merge commit in release notes Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> --- .github/workflows/release.yml | 148 ++++++++++++++++++++++++++-------- 1 file changed, 114 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d63a77..a522b86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,45 +147,125 @@ 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 = @() + $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].Substring(0, [Math]::Min(7, $parts[0].Length)) + $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 } + '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 ($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*" + $headCommitSha = git rev-parse --short HEAD + $releaseNotes += "---`n*Based on commits from $baseSha to $headSha*" $delimiter = "EOF_$(Get-Random)" Write-Output "DEBUG: Writing notes to output using delimiter $delimiter" From 32bc9d42ec8b4e8fb5e83575cf188776b3e74c5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:20:35 +0000 Subject: [PATCH 3/4] fix: address code review comments - fix array handling, add ci/style types, remove unused var Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> --- .github/workflows/release.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a522b86..07a048f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -156,7 +156,7 @@ jobs: Write-Output "DEBUG: Head SHA: $headSha" # Get all commit messages in the PR - $commits = git log --pretty=format:"%H|%s|%b" "$baseSha..$headSha" + $commits = @(git log --pretty=format:"%H|%s|%b" "$baseSha..$headSha") Write-Output "DEBUG: Found $($commits.Count) commits in PR" # Initialize categorized lists @@ -168,6 +168,8 @@ jobs: $tests = @() $chores = @() $builds = @() + $ci = @() + $style = @() $reverts = @() $others = @() @@ -201,6 +203,8 @@ jobs: 'test' { $tests += $entry } 'chore' { $chores += $entry } 'build' { $builds += $entry } + 'ci' { $ci += $entry } + 'style' { $style += $entry } 'revert' { $reverts += $entry } default { $others += "- $subject ($commitHash)" } } @@ -253,6 +257,16 @@ jobs: $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" + $releaseNotes += ($style -join "`n") + "`n`n" + } + if ($reverts.Count -gt 0) { $releaseNotes += "### ⏪ Reverts`n" $releaseNotes += ($reverts -join "`n") + "`n`n" @@ -264,7 +278,6 @@ jobs: } Write-Output "DEBUG: releaseNotes: $releaseNotes" - $headCommitSha = git rev-parse --short HEAD $releaseNotes += "---`n*Based on commits from $baseSha to $headSha*" $delimiter = "EOF_$(Get-Random)" From 76ed5add2e9867ed53a59117b9dcabfdc4cb4095 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:21:25 +0000 Subject: [PATCH 4/4] refactor: use git's built-in short hash format instead of substring Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07a048f..7958ac8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -156,7 +156,7 @@ jobs: Write-Output "DEBUG: Head SHA: $headSha" # Get all commit messages in the PR - $commits = @(git log --pretty=format:"%H|%s|%b" "$baseSha..$headSha") + $commits = @(git log --pretty=format:"%h|%s|%b" "$baseSha..$headSha") Write-Output "DEBUG: Found $($commits.Count) commits in PR" # Initialize categorized lists @@ -180,7 +180,7 @@ jobs: $parts = $line -split '\|', 3 if ($parts.Count -lt 2) { continue } - $commitHash = $parts[0].Substring(0, [Math]::Min(7, $parts[0].Length)) + $commitHash = $parts[0] $subject = $parts[1] $body = if ($parts.Count -eq 3) { $parts[2] } else { "" }