diff --git a/lib/workers/pr/changelog/source-github.js b/lib/workers/pr/changelog/source-github.js index c3369b154e9dda1e6de8a288324c150798035c12..7d29dbb8a1aa1f905ea89720adb707cfbb0578cf 100644 --- a/lib/workers/pr/changelog/source-github.js +++ b/lib/workers/pr/changelog/source-github.js @@ -25,7 +25,7 @@ async function getTags(endpoint, versionScheme, repository) { logger.debug({ repository }, 'repository has no Github tags'); } - return tags.filter(tag => isVersion(tag.name)).map(tag => tag.name); + return tags.map(tag => tag.name); } catch (err) { logger.info({ sourceRepo: repository }, 'Failed to fetch Github tags'); logger.debug({ err }); @@ -44,6 +44,7 @@ async function getChangeLogJSON({ toVersion, repositoryUrl, releases, + depName, }) { if (repositoryUrl === 'https://github.com/DefinitelyTyped/DefinitelyTyped') { logger.debug('No release notes for @types'); @@ -87,7 +88,9 @@ async function getChangeLogJSON({ if (!tags) { tags = await getTags(config.endpoint, versionScheme, repository); } - const tagName = tags.find(tag => equals(tag, release.version)); + const tagName = tags + .filter(tag => isVersion(tag.replace(`${depName}@`, ''))) + .find(tag => equals(tag.replace(`${depName}@`, ''), release.version)); if (tagName) { return tagName; }