Skip to content

Commit d33a865

Browse files
authored
fix: Changelog validation script works again (#4901)
Signed-off-by: Jorge Turrado <[email protected]>
1 parent c8896ce commit d33a865

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/validate-changelog.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function extract_and_check() {
2626
fi
2727

2828
# Separate and sort the **General**: lines
29-
local sorted_general_lines=$(echo "$content" | grep '^- \*\*General\*\*:' | sort --ignore-case --dictionary-order)
29+
local sorted_general_lines=$(echo "$content" | grep '^- \*\*General\*\*:' | LC_ALL=en_US sort --ignore-case --dictionary-order)
3030

3131
# Sort the remaining lines
32-
local sorted_content=$(echo "$content" | grep -v '^- \*\*General\*\*:' | sort --ignore-case --dictionary-order)
32+
local sorted_content=$(echo "$content" | grep -v '^- \*\*General\*\*:' | LC_ALL=en_US sort --ignore-case --dictionary-order)
3333

3434
# Check if sorted_general_lines is not empty, then concatenate
3535
if [[ -n "$sorted_general_lines" ]]; then
@@ -40,7 +40,7 @@ function extract_and_check() {
4040
while IFS= read -r line; do
4141
echo "Error: Wrong pattern found in section: $section , line: $line"
4242
exit 1
43-
done < <(grep -Ev '^(-\s\*\*[^*]+\*\*: .*\(\[#(\d+)\]\(https:\/\/github\.com\/kedacore\/(keda|charts|governance)\/(pull|issues|discussions)\/\2\)(?:\|\[#(\d+)\]\(https:\/\/github\.com\/kedacore\/(keda|charts|governance)\/(pull|issues|discussions)\/\5\)){0,}\))$' <<< "$content")
43+
done < <(grep -Pv '^(-\s\*\*[^*]+\*\*: .*\(\[#(\d+)\]\(https:\/\/github\.com\/kedacore\/(keda|charts|governance)\/(pull|issues|discussions)\/\2\)(?:\|\[#(\d+)\]\(https:\/\/github\.com\/kedacore\/(keda|charts|governance)\/(pull|issues|discussions)\/(?:\5)\)){0,}\))$' <<< "$content")
4444

4545
if [ "$content" != "$sorted_content" ]; then
4646
echo "Error: Section: $section is not sorted correctly. Correct order:"

0 commit comments

Comments
 (0)