Skip to content

Commit a8da0d8

Browse files
fix: scope Zoekt changelog updates to Unreleased (#1563)
* fix: scope Zoekt changelog updates to Unreleased * chore: update changelog * Remove changelog entry for Zoekt updates fix Removed entry about fixing automated Zoekt changelog updates.
1 parent 9e882d4 commit a8da0d8

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/scripts/addZoektSyncChangelogEntry.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ awk -v entry="$entry" '
8383
next
8484
}
8585
86-
in_unreleased && !found_changed && /^## / {
87-
print "### Changed"
88-
print entry
89-
print ""
90-
found_changed = 1
91-
inserted = 1
86+
in_unreleased && /^## / {
87+
if (!found_changed) {
88+
print "### Changed"
89+
print entry
90+
print ""
91+
found_changed = 1
92+
inserted = 1
93+
}
9294
in_unreleased = 0
9395
print
9496
next

.github/scripts/testZoektSync.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ cat > "$changelog_fixture" <<'EOF'
145145
- Fixed something.
146146
147147
## [1.0.0]
148+
149+
### Changed
150+
- Changed something in a released version.
151+
152+
## [0.9.0]
153+
154+
### Changed
155+
- Changed something in an older released version.
148156
EOF
149157

150158
chmod 640 "$changelog_fixture"
@@ -155,6 +163,9 @@ assert_contains "$changelog_fixture" \
155163
assert_contains "$changelog_fixture" \
156164
"- Updated the bundled Zoekt version. [#42](https://github.com/sourcebot-dev/sourcebot/pull/42)" \
157165
"the changelog helper should add the generated PR link"
166+
entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
167+
assert_equals "$entry_count" 1 \
168+
"the changelog helper should add the PR entry only to Unreleased"
158169
CHANGELOG_PATH="$changelog_fixture" "$changelog_script" 42
159170
entry_count=$(grep -Fc "sourcebot/pull/42" "$changelog_fixture")
160171
assert_equals "$entry_count" 1 \

0 commit comments

Comments
 (0)