From a13d38996a4fd60831b037f43267649420f8113b Mon Sep 17 00:00:00 2001 From: Google GitHub Actions Bot <72759630+google-github-actions-bot@users.noreply.github.com> Date: Wed, 18 May 2022 14:52:16 -0500 Subject: [PATCH] chore: build dist release-please-action (#493) --- dist/index.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5878af6..198bb80 100644 --- a/dist/index.js +++ b/dist/index.js @@ -81024,7 +81024,7 @@ class Manifest { }); const component = await strategy.getBranchComponent(); const releasedVersions = {}; - const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), component, config.pullRequestTitlePattern); + const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), config, component); if (latestVersion) { releasedVersions[path] = latestVersion; } @@ -81717,7 +81717,7 @@ function isPublishedVersion(strategy, version) { * @param {string} prefix Limit the release to a specific component. * @param pullRequestTitlePattern Configured PR title pattern. */ -async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix, pullRequestTitlePattern) { +async function latestReleaseVersion(github, targetBranch, releaseFilter, config, prefix) { const branchPrefix = prefix ? prefix.endsWith('-') ? prefix.replace(/-$/, '') @@ -81747,7 +81747,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix, if (branchName.getComponent() !== branchPrefix) { continue; } - const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, pullRequestTitlePattern); + const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, config.pullRequestTitlePattern); if (!pullRequestTitle) { continue; } @@ -81766,7 +81766,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix, if (!tagName) { continue; } - if (tagName.component === branchPrefix) { + if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) { logger_1.logger.debug(`found release for ${prefix}`, tagName.version); if (!commitShas.has(release.sha)) { logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`); @@ -81789,7 +81789,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix, if (!tagName) { continue; } - if (tagName.component === branchPrefix) { + if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) { if (!commitShas.has(tag.sha)) { logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`); continue; @@ -81849,6 +81849,15 @@ function commitsAfterSha(commits, lastReleaseSha) { } return commits.slice(0, index); } +/** + * Returns true if the release tag matches the configured component. Returns + * true if `includeComponentInTag` is false and there is no component in the + * tag, OR if the tag's component matches the release component. + */ +function tagMatchesConfig(tag, branchComponent, includeComponentInTag) { + return ((includeComponentInTag && tag.component === branchComponent) || + (!includeComponentInTag && !tag.component)); +} //# sourceMappingURL=manifest.js.map /***/ }), @@ -113574,7 +113583,7 @@ module.exports = {}; /***/ ((module) => { "use strict"; -module.exports = {"i8":"13.16.4"}; +module.exports = {"i8":"13.16.5"}; /***/ }),