Skip to content

Commit ae4e4d3

Browse files
committed
fix bash
1 parent c571848 commit ae4e4d3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/scripts/extract-breaking-changes.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ while IFS= read -r line; do
2828
# Extract PR number from commit message
2929
if [[ $line =~ \(#([0-9]+)\)$ ]]; then
3030
pr_number="${BASH_REMATCH[1]}"
31-
commit_hash=$(echo "$line" | cut -d' ' -f1)
3231
commit_subject=$(echo "$line" | cut -d' ' -f2- | sed 's/ (#[0-9]*)$//')
3332

3433
# Check if this PR has the breaking change label using GitHub CLI

.github/scripts/format-release-notes.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ if [[ ! -f "$changelog_section" ]]; then
1616
exit 1
1717
fi
1818

19+
# Create temporary file to collect all output
20+
temp_file=$(mktemp)
21+
1922
# Add breaking changes section if it exists
2023
if grep -q "### ⚠️ Breaking Changes" "$changelog_section"; then
21-
cat >> "$output_file" << 'EOF'
24+
cat << 'EOF' >> "$temp_file"
2225
2326
## 🚨 IMPORTANT: Breaking Changes
2427
@@ -28,11 +31,14 @@ EOF
2831

2932
# Extract breaking changes section, format for release notes
3033
sed -n '/### ⚠️ Breaking Changes/,/^### /p' "$changelog_section" | sed '$d' | \
31-
perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' >> "$output_file"
34+
perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' >> "$temp_file"
3235

33-
echo -e "\n---\n" >> "$output_file"
36+
echo -e "\n---\n" >> "$temp_file"
3437
fi
3538

3639
# the complex perl regex is needed because markdown docs render newlines as soft wraps
3740
# while release notes render them as line breaks
38-
perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' "$changelog_section" >> "$output_file"
41+
perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' "$changelog_section" >> "$temp_file"
42+
43+
# Move temp file to final output
44+
mv "$temp_file" "$output_file"

0 commit comments

Comments
 (0)