File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,18 +81,21 @@ jobs:
8181 run : |
8282 $version = "${{ steps.ver.outputs.version }}"
8383
84- # Find the previous standard (non-prerelease) release tag.
85- $prevTag = ""
86- $prevJson = gh release list --repo "$env:GITHUB_REPOSITORY" --exclude-drafts --exclude-prereleases --json tagName --limit 1
84+ # Find when the previous standard (non-prerelease) release was published.
85+ # Range by the release DATE (not the tag): old release tags here are
86+ # orphaned (not ancestors of HEAD) after a history rewrite, so a
87+ # <tag>..HEAD range would return the entire history.
88+ $since = ""
89+ $prevJson = gh release list --repo "$env:GITHUB_REPOSITORY" --exclude-drafts --exclude-prereleases --json publishedAt --limit 1
8790 if ($prevJson) {
8891 $parsed = $prevJson | ConvertFrom-Json
89- if ($parsed) { $prevTag = $parsed[0].tagName }
92+ if ($parsed) { $since = $parsed[0].publishedAt }
9093 }
91- Write-Host "Previous standard release tag : '$prevTag '"
94+ Write-Host "Previous standard release publishedAt : '$since '"
9295
93- # Gather commit subjects since that tag (or from full history on the first release).
94- if ($prevTag -and (git rev-parse --verify --quiet "refs/tags/$prevTag") ) {
95- $commits = git log "$prevTag..HEAD " --no-merges --pretty=format:"- %s"
96+ # Commits after the previous release (or full history on the first release).
97+ if ($since ) {
98+ $commits = git log --since="$since " --no-merges --pretty=format:"- %s"
9699 } else {
97100 Write-Host "No previous standard release found; using full history."
98101 $commits = git log --no-merges --max-count=200 --pretty=format:"- %s"
You can’t perform that action at this time.
0 commit comments