File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,14 +97,13 @@ jobs:
9797 id : get_release_info
9898 shell : bash
9999 run : |
100- VERSION=$(node -p "require('./package.json').version")
100+ # Use node to safely read version from package.json regardless of module type
101+ VERSION=$(node -e "import fs from 'fs'; console.log(JSON.parse(fs.readFileSync('./package.json')).version)" --input-type=module)
101102 echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
102103
103104 # Extract the section from CHANGELOG.md for the current version
104- # It looks for the header ## [VERSION] and takes everything until the next ## [
105- # Then we remove the last line (the next header) and any trailing link if it's there
106- # Using a temporary node script for robust cross-platform parsing
107- cat << 'EOF' > extract_changelog.js
105+ # Using .cjs extension to force CommonJS mode for the extraction script
106+ cat << 'EOF' > extract_changelog.cjs
108107 const fs = require('fs');
109108 const content = fs.readFileSync('CHANGELOG.md', 'utf8');
110109 const version = process.argv[2];
@@ -122,7 +121,7 @@ jobs:
122121 }
123122 EOF
124123
125- node extract_changelog.js $VERSION
124+ node extract_changelog.cjs $VERSION
126125
127126 - name : 🔨 Build Standalone EXE
128127 run : npm run build:sea
You can’t perform that action at this time.
0 commit comments