release-please 13.16.4 → 13.16.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.16.5](https://github.com/googleapis/release-please/compare/v13.16.4...v13.16.5) (2022-05-18)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * all release tag matching if includeComponentInTag is false ([#1442](https://github.com/googleapis/release-please/issues/1442)) ([82a7c71](https://github.com/googleapis/release-please/commit/82a7c7186cf7c30530ce179b42b439400c539b52))
13
+
7
14
  ### [13.16.4](https://github.com/googleapis/release-please/compare/v13.16.3...v13.16.4) (2022-05-17)
8
15
 
9
16
 
@@ -147,7 +147,7 @@ class Manifest {
147
147
  });
148
148
  const component = await strategy.getBranchComponent();
149
149
  const releasedVersions = {};
150
- const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), component, config.pullRequestTitlePattern);
150
+ const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), config, component);
151
151
  if (latestVersion) {
152
152
  releasedVersions[path] = latestVersion;
153
153
  }
@@ -840,7 +840,7 @@ function isPublishedVersion(strategy, version) {
840
840
  * @param {string} prefix Limit the release to a specific component.
841
841
  * @param pullRequestTitlePattern Configured PR title pattern.
842
842
  */
843
- async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix, pullRequestTitlePattern) {
843
+ async function latestReleaseVersion(github, targetBranch, releaseFilter, config, prefix) {
844
844
  const branchPrefix = prefix
845
845
  ? prefix.endsWith('-')
846
846
  ? prefix.replace(/-$/, '')
@@ -870,7 +870,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
870
870
  if (branchName.getComponent() !== branchPrefix) {
871
871
  continue;
872
872
  }
873
- const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, pullRequestTitlePattern);
873
+ const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, config.pullRequestTitlePattern);
874
874
  if (!pullRequestTitle) {
875
875
  continue;
876
876
  }
@@ -889,7 +889,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
889
889
  if (!tagName) {
890
890
  continue;
891
891
  }
892
- if (tagName.component === branchPrefix) {
892
+ if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) {
893
893
  logger_1.logger.debug(`found release for ${prefix}`, tagName.version);
894
894
  if (!commitShas.has(release.sha)) {
895
895
  logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`);
@@ -912,7 +912,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
912
912
  if (!tagName) {
913
913
  continue;
914
914
  }
915
- if (tagName.component === branchPrefix) {
915
+ if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) {
916
916
  if (!commitShas.has(tag.sha)) {
917
917
  logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`);
918
918
  continue;
@@ -972,4 +972,13 @@ function commitsAfterSha(commits, lastReleaseSha) {
972
972
  }
973
973
  return commits.slice(0, index);
974
974
  }
975
+ /**
976
+ * Returns true if the release tag matches the configured component. Returns
977
+ * true if `includeComponentInTag` is false and there is no component in the
978
+ * tag, OR if the tag's component matches the release component.
979
+ */
980
+ function tagMatchesConfig(tag, branchComponent, includeComponentInTag) {
981
+ return ((includeComponentInTag && tag.component === branchComponent) ||
982
+ (!includeComponentInTag && !tag.component));
983
+ }
975
984
  //# sourceMappingURL=manifest.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.16.4",
3
+ "version": "13.16.5",
4
4
  "description": "generate release PRs based on the conventionalcommits.org spec",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": "./build/src/bin/release-please.js",