@ondrejbelza/semantic-release-jira 1.9.3 → 1.9.4

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/dist/success.d.ts CHANGED
@@ -1,3 +1,6 @@
1
- import { PluginConfig } from "./types";
2
- import { SuccessContext } from "semantic-release";
1
+ import { PluginConfig, ReleaseContributions } from "./types";
2
+ import { SuccessContext, Commit } from "semantic-release";
3
+ import { Signale } from "signale";
4
+ import { Version3Client } from "jira.js";
5
+ export declare function getContributions(c: Version3Client, ticketPrefixes: string[], jiraHost: string, commits: readonly Commit[], logger: Signale): Promise<ReleaseContributions>;
3
6
  export declare function success(config: PluginConfig, context: SuccessContext): Promise<void>;
package/dist/success.js CHANGED
@@ -36,6 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getContributions = getContributions;
39
40
  exports.success = success;
40
41
  const utils_1 = require("./utils");
41
42
  const _ = __importStar(require("lodash"));
@@ -46,17 +47,23 @@ const p_limit_1 = __importDefault(require("p-limit"));
46
47
  const error_1 = __importDefault(require("@semantic-release/error"));
47
48
  async function getIssueMetadata(c, issueKey, jiraHost, logger) {
48
49
  logger.info(`Loading info for issue ${issueKey}`);
49
- const issue = await c.issues.getIssue({ issueIdOrKey: issueKey });
50
- return {
51
- title: issue.fields.summary,
52
- assignee: issue.fields.assignee.displayName || "unassigned",
53
- description: _.truncate(issue.fields.description?.content?.[0]?.content?.[0].text, {
54
- length: 100,
55
- }),
56
- key: issue.key,
57
- link: `${jiraHost}/browse/${issue.key}`,
58
- type: issue.fields.issuetype?.name || "unknown",
59
- };
50
+ try {
51
+ const issue = await c.issues.getIssue({ issueIdOrKey: issueKey });
52
+ return {
53
+ title: issue.fields.summary,
54
+ assignee: issue.fields.assignee.displayName || "unassigned",
55
+ description: _.truncate(issue.fields.description?.content?.[0]?.content?.[0].text, {
56
+ length: 100,
57
+ }),
58
+ key: issue.key,
59
+ link: `${jiraHost}/browse/${issue.key}`,
60
+ type: issue.fields.issuetype?.name || "unknown",
61
+ };
62
+ }
63
+ catch (err) {
64
+ logger.error(`Loading info for issue failed: ${issueKey}`);
65
+ throw err;
66
+ }
60
67
  }
61
68
  async function getContributions(c, ticketPrefixes, jiraHost, commits, logger) {
62
69
  const tickets = new Set();
@@ -86,8 +93,14 @@ async function getContributions(c, ticketPrefixes, jiraHost, commits, logger) {
86
93
  const errorMessages = err?.response?.data?.errorMessages || [];
87
94
  let isAllowed = false;
88
95
  for (const allowedMessage of allowedMessages) {
89
- if (errorMessages.includes(allowedMessage)) {
90
- isAllowed = true;
96
+ for (const errorMessage of errorMessages) {
97
+ if (errorMessage.includes(allowedMessage)) {
98
+ isAllowed = true;
99
+ break;
100
+ }
101
+ }
102
+ if (isAllowed) {
103
+ break;
91
104
  }
92
105
  }
93
106
  if (!isAllowed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ondrejbelza/semantic-release-jira",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "semantic release jira releases plugin",
5
5
  "homepage": "https://github.com/mailstepcz/semantic-release-jira#readme",
6
6
  "bugs": {