Skip to content

Commit 47fbb9f

Browse files
committed
build: update newline handling
1 parent 4ad35bb commit 47fbb9f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/update_error_databases.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ jobs:
118118
body="This PR\n\n- updates the error databases\n\nThe following error codes were added:\n\n${table}"
119119
120120
# Add the comment body to the workflow output after escaping to render newlines:
121-
body="${body//\\n/'%0A'}"
121+
body="${body//\\n/$'\n'}"
122+
body="${body//'%'/'%25'}"
123+
body="${body//$'\n'/'%0A'}"
124+
body="${body//$'\r'/'%0D'}"
122125
echo "body=${body}" >> $GITHUB_OUTPUT
123126
124127
# Disable Git hooks:

lib/node_modules/@stdlib/error/tools/database/scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function main() {
214214
'flag': 'a' // Append to existing file
215215
};
216216
keys = objectKeys( data );
217-
csv = '';
217+
csv = '\n';
218218
for ( i = 0; i < keys.length; i++ ) {
219219
key = keys[ i ];
220220
csv += '"' + key + '","' + escapeQuotes( data[ key ] ) + '","' + types[ key ] + '"\n'; // Note: ensures trailing newline

0 commit comments

Comments
 (0)