Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Use the encoding parameter to get the file contents as a string
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Jan 22, 2021
1 parent 7c6896a commit bbb2212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script:
const changelog = require('fs').readFileSync('CHANGELOG.md').split('\n');
const changelog = require('fs').readFileSync('CHANGELOG.md', { encoding: 'utf-8' }).split('\n');
const start = changelog.findIndex(line => line.startsWith('## '));
const end = changelog.findIndex((line, index) => line.startsWith('## ') && index > start);
return changelog.slice(startIndex, endIndex).join('\n');
Expand Down

0 comments on commit bbb2212

Please sign in to comment.