Skip to content

Commit b5dc657

Browse files
committed
refactor: extract changelog path
1 parent 6e40a90 commit b5dc657

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

src/changelog-check.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ async function checkChangelogFile(
392392
releaseSection = packageVersion;
393393
} else {
394394
throw new Error(
395-
`Could not find section for version '${packageVersion}' in changelog`,
395+
`Could not find section for version '${packageVersion}' in the changelog ("${changelogPath}").`,
396396
);
397397
}
398398
}
@@ -585,16 +585,13 @@ async function main() {
585585
const checkResults = await Promise.all(
586586
changedPackages.map(async (pkgInfo) => {
587587
try {
588-
await checkChangelogFile(
589-
path.join(
590-
fullRepoPath,
591-
pkgInfo.base,
592-
pkgInfo.package,
593-
'CHANGELOG.md',
594-
),
595-
prNumber,
596-
pkgInfo.newVersion,
588+
const changelogPath = path.join(
589+
fullRepoPath,
590+
pkgInfo.base,
591+
pkgInfo.package,
592+
'CHANGELOG.md',
597593
);
594+
await checkChangelogFile(changelogPath, prNumber, pkgInfo.newVersion);
598595
console.log(
599596
`CHANGELOG.md for ${pkgInfo.package} has been correctly updated.`,
600597
);

0 commit comments

Comments
 (0)