From 255ec8779ca20bff5079a4bd32adff9f2e7c9f2d Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sun, 9 Dec 2018 22:15:44 +0100 Subject: [PATCH] feat(changelog): match against compound tags --- lib/workers/pr/changelog/source-github.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/workers/pr/changelog/source-github.js b/lib/workers/pr/changelog/source-github.js index c3369b154e..7d29dbb8a1 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; } -- GitLab