Skip to content

Commit

Permalink
fix: Changelog validation script works again (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
JorTurFer authored Sep 12, 2023
1 parent 8fbc83c commit aadaf60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hack/validate-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ function extract_and_check() {
fi

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

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

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

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

0 comments on commit aadaf60

Please sign in to comment.