mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 07:04:32 +02:00
ci: fix dangerjs when jira link has null description
This commit is contained in:
@@ -165,7 +165,7 @@ module.exports = async function () {
|
|||||||
* or null if not found.
|
* or null if not found.
|
||||||
*/
|
*/
|
||||||
async function getGitHubClosingLink(jiraIssueKey) {
|
async function getGitHubClosingLink(jiraIssueKey) {
|
||||||
let jiraDescrition = "";
|
let jiraDescription = "";
|
||||||
|
|
||||||
// Get JIRA ticket description content
|
// Get JIRA ticket description content
|
||||||
try {
|
try {
|
||||||
@@ -176,7 +176,9 @@ module.exports = async function () {
|
|||||||
password: process.env.DANGER_JIRA_PASSWORD,
|
password: process.env.DANGER_JIRA_PASSWORD,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
jiraDescrition = response.data.fields.description;
|
if (response.data.fields.description) {
|
||||||
|
jiraDescription = response.data.fields.description;
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -184,7 +186,7 @@ module.exports = async function () {
|
|||||||
// Find GitHub closing link in description
|
// Find GitHub closing link in description
|
||||||
const regexClosingGhLink =
|
const regexClosingGhLink =
|
||||||
/Closes\s+(https:\/\/github.com\/\S+\/\S+\/issues\/\d+)/;
|
/Closes\s+(https:\/\/github.com\/\S+\/\S+\/issues\/\d+)/;
|
||||||
const closingGithubLink = jiraDescrition.match(regexClosingGhLink);
|
const closingGithubLink = jiraDescription.match(regexClosingGhLink);
|
||||||
|
|
||||||
if (closingGithubLink) {
|
if (closingGithubLink) {
|
||||||
return closingGithubLink[1];
|
return closingGithubLink[1];
|
||||||
|
Reference in New Issue
Block a user