@docupace/pipeline 1.0.35-matttest.2 → 1.0.35-matttest.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/package.json +1 -1
- package/src/changeset/cli.js +16 -6
- package/src/next/jira.js +1 -4
package/package.json
CHANGED
package/src/changeset/cli.js
CHANGED
|
@@ -254,14 +254,24 @@ program
|
|
|
254
254
|
const url = `/rest/api/2/issue/${jiraTicketId}`;
|
|
255
255
|
console.debug('url: ', url);
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
const jiraBaseUrl = 'https://docupacellc.atlassian.net';
|
|
258
|
+
const jiraEmail = process.env.JIRA_API_EMAIL;
|
|
259
|
+
const jiraApiKey = process.env.JIRA_API_KEY;
|
|
260
|
+
const jiraFullApiKey = `${jiraEmail}:${jiraApiKey}`;
|
|
261
|
+
const jiraUrl = `${jiraBaseUrl}/rest/api/2/issue/${jiraTicketId}`;
|
|
262
|
+
const jiraResponse = await fetch(jiraUrl, {
|
|
263
|
+
headers: {
|
|
264
|
+
Authorization: `Basic ${Buffer.from(jiraFullApiKey).toString('base64')}`,
|
|
265
|
+
'Content-Type': 'application/json',
|
|
266
|
+
},
|
|
267
|
+
});
|
|
261
268
|
|
|
262
|
-
if (
|
|
263
|
-
throw new Error(
|
|
269
|
+
if (!jiraResponse.ok) {
|
|
270
|
+
throw new Error(
|
|
271
|
+
`Failed to fetch Jira ticket. Status: ${jiraResponse.status}`,
|
|
272
|
+
);
|
|
264
273
|
}
|
|
274
|
+
const jiraTicketData = await jiraResponse.json();
|
|
265
275
|
|
|
266
276
|
const jiraSummary = jiraTicketData.fields.summary;
|
|
267
277
|
|
package/src/next/jira.js
CHANGED
|
@@ -74,10 +74,7 @@ export async function updateComponentVersion(issueKey, packageName, version) {
|
|
|
74
74
|
*/
|
|
75
75
|
export async function makeJiraRequest(endpoint, options = {}) {
|
|
76
76
|
try {
|
|
77
|
-
const response = await jiraClient.get(
|
|
78
|
-
url: endpoint,
|
|
79
|
-
...options,
|
|
80
|
-
});
|
|
77
|
+
const response = await jiraClient.get(endpoint, options);
|
|
81
78
|
return response.data;
|
|
82
79
|
} catch (error) {
|
|
83
80
|
console.error(`Error making Jira request: ${error.message}`);
|