Skip to content

Commit 6e57af4

Browse files
authored
fix: allow for relative paths for changelog file (#288)
Re nodejs/node#57343 (comment) Signed-off-by: flakey5 <[email protected]>
1 parent 97b3495 commit 6e57af4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/releases.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ const getChangelogFromFileSystem = async changelogUrl =>
3535
* @param {string} changelogPath The given URL to the Node.js CHANGELOG.md file
3636
*/
3737
const createNodeReleases = changelogPath => {
38-
const changelogUrl = new URL(changelogPath);
38+
const changelogUrl = URL.parse(changelogPath);
3939

4040
const changelogStrategy =
41-
changelogUrl.protocol === 'file:'
42-
? getChangelogFromFileSystem(changelogUrl)
41+
!changelogUrl || changelogUrl.protocol === 'file:'
42+
? getChangelogFromFileSystem(changelogUrl ?? changelogPath)
4343
: getChangelogFromNetwork(changelogUrl);
4444

4545
/**

0 commit comments

Comments
 (0)