Skip to content

Commit bf90303

Browse files
CopilotDRSDavidSoft
andcommitted
Remove Change Type column and add collapsible changelog for major updates
Co-authored-by: DRSDavidSoft <[email protected]>
1 parent e64c0b1 commit bf90303

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

.github/workflows/vendor.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
Set-GHVariable -Name COUNT_UPDATED -Value $count
4747
$newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
4848
$listUpdated = ""
49-
$updateMessage = "| Name | Old Version | New Version | Change Type |`n| :--- | :---: | :---: | :---: |`n"
49+
$updateMessage = "| Name | Old Version | New Version |`n| :--- | :---: | :---: |`n"
50+
$majorUpdates = @()
5051
foreach ($s in $newVersion) {
5152
$oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version
5253
if ($s.version -ne $oldVersion) {
@@ -55,6 +56,7 @@ jobs:
5556
# Determine change type and emoji
5657
$changeType = "unknown"
5758
$emoji = "🔄"
59+
$isMajor = $false
5860
try {
5961
# Handle versions with more than 4 parts
6062
$oldVerStr = $oldVersion.Split('-')[0]
@@ -75,6 +77,7 @@ jobs:
7577
if ($newVer.Major -gt $oldVer.Major) {
7678
$changeType = "major"
7779
$emoji = "⚠️"
80+
$isMajor = $true
7881
} elseif ($newVer.Minor -gt $oldVer.Minor) {
7982
$changeType = "minor"
8083
$emoji = "✨"
@@ -88,14 +91,41 @@ jobs:
8891
$emoji = "🔄"
8992
}
9093
94+
# Track major updates for changelog section
95+
if ($isMajor) {
96+
$compareUrl = "$repoUrl/compare/v$oldVersion...v$($s.version)"
97+
$majorUpdates += @{
98+
name = $s.name
99+
oldVersion = $oldVersion
100+
newVersion = $s.version
101+
compareUrl = $compareUrl
102+
repoUrl = $repoUrl
103+
}
104+
}
105+
91106
$listUpdated += "$($s.name) v$($s.version), "
92-
$updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | \`$oldVersion\` | \`$($s.version)\` | $changeType |`n"
107+
$updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | \`$oldVersion\` | \`$($s.version)\` |`n"
93108
}
94109
}
95110
if ($count -eq 0) { return }
96111
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
97112
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
98113
114+
# Generate major updates changelog section
115+
if ($majorUpdates.Count -gt 0) {
116+
$changelogSection = "`n<details>`n<summary>⚠️ Major version updates - View changelog</summary>`n`n"
117+
foreach ($update in $majorUpdates) {
118+
$changelogSection += "### [$($update.name)]($($update.repoUrl))`n"
119+
$changelogSection += "**$($update.oldVersion)** → **$($update.newVersion)**`n`n"
120+
$changelogSection += "- [View full changelog]($($update.compareUrl))`n"
121+
$changelogSection += "- [Release notes]($($update.repoUrl)/tag/v$($update.newVersion))`n`n"
122+
}
123+
$changelogSection += "</details>`n"
124+
echo "CHANGELOG_SECTION<<<EOF`n$changelogSection`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
125+
} else {
126+
echo "CHANGELOG_SECTION=" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
127+
}
128+
99129
- name: Summary - Update check results
100130
shell: pwsh
101131
run: |
@@ -178,6 +208,8 @@ jobs:
178208
179209
${{ env.UPDATE_MESSAGE }}
180210
211+
${{ env.CHANGELOG_SECTION }}
212+
181213
---
182214
183215
${{ env.HAS_BREAKING_CHANGES == 'True' && '⚠️ **This update contains major version changes that may include breaking changes.**' || 'ℹ️ This update only contains minor or patch changes.' }}

0 commit comments

Comments
 (0)