@ondrejbelza/semantic-release-jira 1.4.2 → 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 +10 -4
- 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,14 +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: ${projectIdOrKey}, versionName: ${newVersionName}`);
|
|
71
72
|
const version = await c.projectVersions.createVersion({
|
|
72
73
|
name: newVersionName,
|
|
73
74
|
description: newVersionDescription,
|
|
74
|
-
projectId:
|
|
75
|
+
projectId: projectIdOrKey,
|
|
75
76
|
released: true,
|
|
76
77
|
releaseDate: new Date().toISOString(),
|
|
77
78
|
archived: false,
|
|
78
79
|
});
|
|
80
|
+
logger.success(`Created new jira version ${version.id}`);
|
|
79
81
|
return version;
|
|
80
82
|
}
|
|
81
83
|
catch (err) {
|
|
@@ -132,7 +134,11 @@ async function success(config, context) {
|
|
|
132
134
|
logger.info(`using jira description '${consts_1.DEFAULT_RELEASE_DESCRIPTION_TEMPLATE}'`);
|
|
133
135
|
const c = (0, jira_client_1.CreateJiraClient)(logger, jiraHost, env.JIRA_EMAIL, env.JIRA_TOKEN);
|
|
134
136
|
const project = await c.projects.getProject({ projectIdOrKey: projectKey });
|
|
135
|
-
|
|
137
|
+
if (!project.id) {
|
|
138
|
+
throw new error_1.default("Missing project id!");
|
|
139
|
+
}
|
|
140
|
+
logger.info(`Attempting to create new version for project ${project.name}, id: ${project.id}`);
|
|
141
|
+
const version = await findOrCreateVersion(c, project.id, newVersionName, newVersionDescription, logger);
|
|
136
142
|
const concurrentLimit = (0, p_limit_1.default)(10);
|
|
137
143
|
const edits = [];
|
|
138
144
|
for (const ticket of tickets) {
|
package/package.json
CHANGED