@@ -41,45 +41,27 @@ runs:
4141
4242 "tag=$tag" >> $env:GITHUB_OUTPUT
4343
44- - name : Get commits
45- id : history
44+ - name : Determine bump
45+ id : bump
4646 shell : pwsh
4747 run : |
4848 $last = "${{ steps.tag.outputs.tag }}"
49+ $noTag = "${{ steps.tag.outputs.no_tag }}" -eq "true"
4950
50- if ($last -eq "v1.0.0" ) {
51- $log = git log --pretty=format:%s
51+ if ($noTag ) {
52+ $commits = @( git log --pretty=format:%s -n 50)
5253 } else {
53- $log = git log "$last..HEAD" --pretty=format:%s
54+ $commits = @( git log "$last..HEAD" --pretty=format:%s)
5455 }
5556
56- $logText = $log -join "`n"
57-
58- "log<<EOF" >> $env:GITHUB_OUTPUT
59- $logText >> $env:GITHUB_OUTPUT
60- "EOF" >> $env:GITHUB_OUTPUT
61-
62- - name : Determine bump
63- id : bump
64- shell : pwsh
65- run : |
66- $log = "${{ steps.history.outputs.log }}"
6757 $bump = "patch"
68-
69- if ($log -match "BREAKING CHANGE") {
70- $bump = "major"
71- }
72- elseif ($log -match "^[a-z]+(\(.+\))?!:") {
73- $bump = "major"
74- }
75- elseif ($log -match "^major") {
76- $bump = "major"
77- }
78- elseif ($log -match "^feat") {
79- $bump = "minor"
80- }
81- elseif ($log -match "^minor") {
82- $bump = "minor"
58+ foreach ($line in $commits) {
59+ if ($line -match "BREAKING CHANGE") { $bump = "major"; break }
60+ if ($line -match "^[a-z]+(\(.+\))?!:") { $bump = "major"; break }
61+ if ($line -match "^major") { $bump = "major"; break }
62+ if ($line -match "^feat|^minor") {
63+ if ($bump -ne "major") { $bump = "minor" }
64+ }
8365 }
8466
8567 "bump=$bump" >> $env:GITHUB_OUTPUT
@@ -128,11 +110,11 @@ runs:
128110 $content += ""
129111
130112 if ($noTag) {
131- $content += "First release — please check git log for full details."
113+ $content += "First release - please check git log for full details."
132114 } else {
133115 $previousTag = "${{ steps.tag.outputs.tag }}"
134- $log = git log "$previousTag..HEAD" --pretty=format:%s
135- $content += $log
116+ $commits = @( git log "$previousTag..HEAD" --pretty=format:%s -n 50)
117+ $content += $commits
136118 }
137119
138120 $content | Out-File CHANGELOG.md -Encoding utf8
0 commit comments