@ondrejbelza/semantic-release-jira 1.4.1 → 1.4.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.
- package/dist/success.js +7 -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, projectId, newVersionName, newVersionDescription, logger) {
|
|
61
61
|
const versions = await c.projectVersions.getProjectVersions({
|
|
62
|
-
projectIdOrKey:
|
|
62
|
+
projectIdOrKey: projectId,
|
|
63
63
|
});
|
|
64
64
|
for (const v of versions) {
|
|
65
65
|
if (v.name === newVersionName) {
|
|
@@ -68,12 +68,14 @@ async function findOrCreateVersion(c, projectKey, newVersionName, newVersionDesc
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
|
+
logger.info(`Creating new version in jira projectId: ${projectId}, versionName: ${newVersionName}`);
|
|
71
72
|
const version = await c.projectVersions.createVersion({
|
|
72
73
|
name: newVersionName,
|
|
73
74
|
description: newVersionDescription,
|
|
74
|
-
projectId:
|
|
75
|
+
projectId: projectId,
|
|
75
76
|
released: true,
|
|
76
77
|
releaseDate: new Date().toISOString(),
|
|
78
|
+
archived: false,
|
|
77
79
|
});
|
|
78
80
|
return version;
|
|
79
81
|
}
|
|
@@ -131,7 +133,8 @@ async function success(config, context) {
|
|
|
131
133
|
logger.info(`using jira description '${consts_1.DEFAULT_RELEASE_DESCRIPTION_TEMPLATE}'`);
|
|
132
134
|
const c = (0, jira_client_1.CreateJiraClient)(logger, jiraHost, env.JIRA_EMAIL, env.JIRA_TOKEN);
|
|
133
135
|
const project = await c.projects.getProject({ projectIdOrKey: projectKey });
|
|
134
|
-
|
|
136
|
+
logger.info(`Attempting to create new version for project ${project.name}, id: ${project.id}`);
|
|
137
|
+
const version = await findOrCreateVersion(c, Number(project.id), newVersionName, newVersionDescription, logger);
|
|
135
138
|
const concurrentLimit = (0, p_limit_1.default)(10);
|
|
136
139
|
const edits = [];
|
|
137
140
|
for (const ticket of tickets) {
|
package/package.json
CHANGED