From 91e1621b100196f53c75cbdd657f5b9b349cfa31 Mon Sep 17 00:00:00 2001 From: dtor Date: Wed, 11 Dec 2024 11:27:10 +0000 Subject: [PATCH] ci: fix regex pattern --- .github/workflows/check_pr_description.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_pr_description.yml b/.github/workflows/check_pr_description.yml index a349448..dfcbb23 100644 --- a/.github/workflows/check_pr_description.yml +++ b/.github/workflows/check_pr_description.yml @@ -16,9 +16,9 @@ jobs: PR_BODY=$(curl -s https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r .body) echo "$PR_BODY" - pattern="https://github\.com/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/issues/([0-9]+)" + pattern="Issue:\s+#\d+|Issue:\s+https://github\.com/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/issues/\d+" if [[ ! "$PR_BODY" =~ $pattern ]]; then - echo "Error: PR description must include an issue link in the format 'Issue: # 123' or 'Issue: https://github.com/owner/repo/issues/123'." >&2 + echo "Error: PR description must include an issue link in the format 'Issue: #123' or 'Issue: https://github.com/owner/repo/issues/123'." >&2 exit 1 else echo "PR description contains a valid issue link." @@ -26,4 +26,4 @@ jobs: - name: Fail PR if no issue link found if: failure() run: |- - echo "Please add an issue link in the format 'Issue: # 123' or 'Issue: https://github.com/owner/repo/issues/123' in the PR description." + echo "Please add an issue link in the format 'Issue: #123' or 'Issue: https://github.com/owner/repo/issues/123' in the PR description."