mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Add v3 changelog validation workflow
This workflow validates changelog entries in PRs targeting v3-alpha branch: - Detects entries added to already-released versions using diff analysis - Automatically moves misplaced entries to [Unreleased] section - Uses proper ### Category format for Keep a Changelog compliance - Commits fixes back to PR with clear feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a25ea74d5c
commit
52cd0d4cc7
1 changed files with 12 additions and 3 deletions
15
.github/workflows/v3-check-changelog.yml
vendored
15
.github/workflows/v3-check-changelog.yml
vendored
|
|
@ -235,11 +235,20 @@ jobs:
|
|||
if strings.HasPrefix(line, "### ") {
|
||||
return strings.TrimSpace(line[4:])
|
||||
}
|
||||
if strings.HasPrefix(line, "## ") {
|
||||
if strings.HasPrefix(line, "## ") &&
|
||||
!strings.Contains(line, "[Unreleased]") &&
|
||||
!strings.Contains(line, "v3.0.0-alpha") {
|
||||
// This is a malformed category like "## Added" - should be "### Added"
|
||||
// But we'll handle it for backward compatibility
|
||||
return strings.TrimSpace(line[3:])
|
||||
}
|
||||
if strings.HasPrefix(line, "## ") &&
|
||||
(strings.Contains(line, "[Unreleased]") || strings.Contains(line, "v3.0.0-alpha")) {
|
||||
// This is a version section header, stop looking
|
||||
break
|
||||
}
|
||||
}
|
||||
return "Unknown"
|
||||
return "Added" // Default fallback for new entries
|
||||
}
|
||||
|
||||
func attemptFix(content string, issues []Issue) (bool, error) {
|
||||
|
|
@ -301,7 +310,7 @@ jobs:
|
|||
insertPos := unreleasedStart + 1
|
||||
|
||||
for i := unreleasedStart + 1; i < unreleasedEnd && i < len(lines); i++ {
|
||||
if strings.Contains(lines[i], "### " + category) {
|
||||
if strings.Contains(lines[i], "### " + category) || strings.Contains(lines[i], "## " + category) {
|
||||
categoryFound = true
|
||||
// Find the end of this category to append entries
|
||||
for j := i + 1; j < unreleasedEnd && j < len(lines); j++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue