Skip to content

Commit a58077b

Browse files
committed
use python for CHANGELOG extraction script
1 parent 80e48d9 commit a58077b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/release-build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,16 @@ jobs:
328328
")
329329
330330
# Extract CHANGELOG entries for this version
331-
CHANGELOG_ENTRIES=$(node -e "
332-
const fs = require('fs');
333-
const content = fs.readFileSync('CHANGELOG.md', 'utf8');
334-
const versionPattern = new RegExp(\`## v\${{ github.event.inputs.version }}.*?\\n(.*?)(?=\\n## |$)\`, 'gs');
335-
const versionMatch = content.match(versionPattern);
336-
if (versionMatch && versionMatch[0]) {
337-
const entries = versionMatch[0].replace(/^## v\${{ github.event.inputs.version }}.*?\\n/, '').trim();
338-
if (entries) {
339-
console.log(entries);
340-
}
341-
}
331+
CHANGELOG_ENTRIES=$(python3 -c "
332+
import re
333+
with open('CHANGELOG.md', 'r') as f:
334+
content = f.read()
335+
version_pattern = r'## v${{ github.event.inputs.version }}.*?\n(.*?)(?=\n## |\Z)'
336+
version_match = re.search(version_pattern, content, re.DOTALL)
337+
if version_match:
338+
entries = version_match.group(1).strip()
339+
if entries:
340+
print(entries)
342341
")
343342
344343
# Create release notes

0 commit comments

Comments
 (0)