@ondrejbelza/semantic-release-jira 1.4.3 → 1.4.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.js +9 -5
- package/package.json +1 -1
package/dist/success.js
CHANGED
|
@@ -57,9 +57,9 @@ function getMentionedTickets(ticketPrefix, commits, logger) {
|
|
|
57
57
|
}
|
|
58
58
|
return [...tickets];
|
|
59
59
|
}
|
|
60
|
-
async function findOrCreateVersion(c,
|
|
60
|
+
async function findOrCreateVersion(c, projectIdOrKey, newVersionName, newVersionDescription, logger) {
|
|
61
61
|
const versions = await c.projectVersions.getProjectVersions({
|
|
62
|
-
projectIdOrKey
|
|
62
|
+
projectIdOrKey,
|
|
63
63
|
});
|
|
64
64
|
for (const v of versions) {
|
|
65
65
|
if (v.name === newVersionName) {
|
|
@@ -68,15 +68,16 @@ async function findOrCreateVersion(c, projectId, newVersionName, newVersionDescr
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
|
-
logger.info(`Creating new version in jira projectId: ${
|
|
71
|
+
logger.info(`Creating new version in jira projectId: ${projectIdOrKey}, versionName: ${newVersionName}`);
|
|
72
72
|
const version = await c.projectVersions.createVersion({
|
|
73
73
|
name: newVersionName,
|
|
74
74
|
description: newVersionDescription,
|
|
75
|
-
projectId:
|
|
75
|
+
projectId: projectIdOrKey,
|
|
76
76
|
released: true,
|
|
77
77
|
releaseDate: new Date().toISOString(),
|
|
78
78
|
archived: false,
|
|
79
79
|
});
|
|
80
|
+
logger.success(`Created new jira version ${version.id}`);
|
|
80
81
|
return version;
|
|
81
82
|
}
|
|
82
83
|
catch (err) {
|
|
@@ -133,8 +134,11 @@ async function success(config, context) {
|
|
|
133
134
|
logger.info(`using jira description '${consts_1.DEFAULT_RELEASE_DESCRIPTION_TEMPLATE}'`);
|
|
134
135
|
const c = (0, jira_client_1.CreateJiraClient)(logger, jiraHost, env.JIRA_EMAIL, env.JIRA_TOKEN);
|
|
135
136
|
const project = await c.projects.getProject({ projectIdOrKey: projectKey });
|
|
137
|
+
if (!project.id) {
|
|
138
|
+
throw new error_1.default("Missing project id!");
|
|
139
|
+
}
|
|
136
140
|
logger.info(`Attempting to create new version for project ${project.name}, id: ${project.id}`);
|
|
137
|
-
const version = await findOrCreateVersion(c,
|
|
141
|
+
const version = await findOrCreateVersion(c, project.id, newVersionName, newVersionDescription, logger);
|
|
138
142
|
const concurrentLimit = (0, p_limit_1.default)(10);
|
|
139
143
|
const edits = [];
|
|
140
144
|
for (const ticket of tickets) {
|
package/package.json
CHANGED