release-please 13.0.0-candidate.2 → 13.0.0-candidate.3

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.
@@ -127,7 +127,7 @@ class Manifest {
127
127
  });
128
128
  const component = await strategy.getComponent();
129
129
  const releasedVersions = {};
130
- const latestVersion = await latestReleaseVersion(github, targetBranch, component);
130
+ const latestVersion = await latestReleaseVersion(github, targetBranch, config.includeComponentInTag ? component : '');
131
131
  if (latestVersion) {
132
132
  releasedVersions[path] = latestVersion;
133
133
  }
@@ -503,7 +503,7 @@ class Manifest {
503
503
  const strategiesByPath = await this.getStrategiesByPath();
504
504
  for (const path in this.repositoryConfig) {
505
505
  const strategy = strategiesByPath[path];
506
- const component = strategy.component || (await strategy.getDefaultComponent()) || '';
506
+ const component = (await strategy.getComponent()) || '';
507
507
  if (this._pathsByComponent[component]) {
508
508
  logger_1.logger.warn(`Multiple paths for ${component}: ${this._pathsByComponent[component]}, ${path}`);
509
509
  }
@@ -51,6 +51,9 @@ class Strategy {
51
51
  this.includeComponentInTag = (_a = options.includeComponentInTag) !== null && _a !== void 0 ? _a : true;
52
52
  }
53
53
  async getComponent() {
54
+ if (!this.includeComponentInTag) {
55
+ return '';
56
+ }
54
57
  return this.component || (await this.getDefaultComponent());
55
58
  }
56
59
  async getDefaultComponent() {
@@ -167,23 +170,28 @@ class Strategy {
167
170
  */
168
171
  async buildRelease(mergedPullRequest) {
169
172
  if (this.skipGitHubRelease) {
170
- return undefined;
173
+ logger_1.logger.info('Release skipped from strategy config');
174
+ return;
175
+ }
176
+ if (!mergedPullRequest.sha) {
177
+ logger_1.logger.error('Pull request should have been merged');
178
+ return;
171
179
  }
172
180
  const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title) ||
173
181
  pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, manifest_1.MANIFEST_PULL_REQUEST_TITLE_PATTERN);
174
182
  if (!pullRequestTitle) {
175
- throw new Error(`Bad pull request title: '${mergedPullRequest.title}'`);
183
+ logger_1.logger.error(`Bad pull request title: '${mergedPullRequest.title}'`);
184
+ return;
176
185
  }
177
186
  const branchName = branch_name_1.BranchName.parse(mergedPullRequest.headBranchName);
178
187
  if (!branchName) {
179
- throw new Error(`Bad branch name: ${mergedPullRequest.headBranchName}`);
180
- }
181
- if (!mergedPullRequest.sha) {
182
- throw new Error('Pull request should have been merged');
188
+ logger_1.logger.error(`Bad branch name: ${mergedPullRequest.headBranchName}`);
189
+ return;
183
190
  }
184
191
  const pullRequestBody = pull_request_body_1.PullRequestBody.parse(mergedPullRequest.body);
185
192
  if (!pullRequestBody) {
186
- throw new Error('could not parse pull request body as a release PR');
193
+ logger_1.logger.error('Could not parse pull request body as a release PR');
194
+ return;
187
195
  }
188
196
  const component = await this.getComponent();
189
197
  logger_1.logger.info('component:', component);
@@ -200,7 +208,8 @@ class Strategy {
200
208
  }
201
209
  const version = pullRequestTitle.getVersion() || (releaseData === null || releaseData === void 0 ? void 0 : releaseData.version);
202
210
  if (!version) {
203
- throw new Error('Pull request should have included version');
211
+ logger_1.logger.error('Pull request should have included version');
212
+ return;
204
213
  }
205
214
  const tag = new tag_name_1.TagName(version, this.includeComponentInTag ? component : undefined, this.tagSeparator);
206
215
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.0.0-candidate.2",
3
+ "version": "13.0.0-candidate.3",
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",