Skip to content

Commit e6d1f55

Browse files
fixed multiple entries bug for sunset date
1 parent 4967b9b commit e6d1f55

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/cli/internal/changelog/changelog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func findChangelogEntry(changelog []*Entry, date, operationID, version, changeCo
457457
}
458458

459459
for _, v := range path.Versions {
460-
if v.Version != version {
460+
if version != "" && v.Version != version {
461461
continue
462462
}
463463

tools/cli/internal/changelog/sunset.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ func (m *Changelog) newOasDiffEntriesFromSunsetEndpoints(
4343
continue
4444
}
4545

46-
// Avoid adding duplicates in the changelog
47-
if findChangelogEntry(m.BaseChangelog, config.Revision.Sunset, operationID, version, endpointRemovedCode) == nil {
46+
// Avoid adding duplicates in the changelog.
47+
// Passing version="" to findChangelogEntry since the sunset date is the same for all the API versions
48+
if findChangelogEntry(m.BaseChangelog, config.Revision.Sunset, operationID, "", endpointRemovedCode) == nil {
4849
changes = append(changes, &outputfilter.OasDiffEntry{
4950
Date: config.Revision.Sunset,
5051
ID: endpointRemovedCode,

0 commit comments

Comments
 (0)