From 22c0405d20ded3c4708ab6b377b8cb9b16665337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Arnholtz?= Date: Fri, 2 May 2025 09:49:27 +0200 Subject: [PATCH] Update jira-pr-title.yml --- .github/workflows/jira-pr-title.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jira-pr-title.yml b/.github/workflows/jira-pr-title.yml index b6b6d67..7452268 100644 --- a/.github/workflows/jira-pr-title.yml +++ b/.github/workflows/jira-pr-title.yml @@ -69,6 +69,26 @@ jobs: const title = `[PEAKON-2516] ${prTitle}`; await github.rest.pulls.update({owner, repo, pull_number, title}); } - } else if (!jiraPattern.test(prTitle)) { + } else if (!jiraPattern.test(prTitle)) { + const issue_number = data.number; + + const body = ` + It looks like your PR title doesn't include a JIRA ticket. + + Please add a ticket to the title (e.g. \`PEAKON-1234\`) or comment with one of the following to create one automatically: + + - \`@peakon-bot create-jira PEAKONADX\` + - \`@peakon-bot create-jira PEAKONBETO\` + - \`@peakon-bot create-jira PEAKONDEVEX\` + - \`@peakon-bot create-jira PEAKONFND\` + - \`@peakon-bot create-jira PEAKONIN\` + - \`@peakon-bot create-jira PEAKONINLE\` + - \`@peakon-bot create-jira PEAKONLIGHT\` + - \`@peakon-bot create-jira PEAKONPOW\` + `; + + await github.rest.issues.createComment({ owner, repo, issue_number, body }); + core.setFailed('Cannot find a JIRA ticket in the PR title'); - } + } +