mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-05 08:22:29 +00:00
fix(ci): narrow issue reference parsing
This commit is contained in:
committed by
Tam Nhu Tran
parent
f815db391d
commit
2a3bc6807f
@@ -139,7 +139,7 @@ jobs:
|
||||
|
||||
COMMIT_TEXT=$(git log $RANGE --pretty=format:"%s%n%b" 2>/dev/null || true)
|
||||
ISSUES_FROM_COMMITS=$(printf '%s\n' "$COMMIT_TEXT" | \
|
||||
perl -ne 'if (/(fixes|closes|resolves|refs?)(.*)/i) { print "$2\n"; }' | \
|
||||
perl -ne 'while (/\b(?:fixes|closes|resolves|refs?)\s+((?:#[0-9]+\b(?:\s*(?:,|and)?\s*#[0-9]+\b)*))/ig) { print "$1\n"; }' | \
|
||||
grep -oE '#[0-9]+' || true)
|
||||
|
||||
PR_CANDIDATES=$(printf '%s\n' "$COMMIT_TEXT" | \
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
done
|
||||
|
||||
ISSUES_FROM_PRS=$(printf '%s\n' "$PR_TEXT" | \
|
||||
perl -ne 'if (/(fixes|closes|resolves|refs?)(.*)/i) { print "$2\n"; }' | \
|
||||
perl -ne 'while (/\b(?:fixes|closes|resolves|refs?)\s+((?:#[0-9]+\b(?:\s*(?:,|and)?\s*#[0-9]+\b)*))/ig) { print "$1\n"; }' | \
|
||||
grep -oE '#[0-9]+' || true)
|
||||
|
||||
ISSUES=$(printf '%s\n%s\n' "$ISSUES_FROM_COMMITS" "$ISSUES_FROM_PRS" | \
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
$PR_BODY
|
||||
$COMMIT_TEXT"
|
||||
PR_ISSUES=$(printf '%s\n' "$PR_TEXT" | \
|
||||
perl -ne 'if (/(fixes|closes|resolves|refs?)(.*)/i) { print "$2\n"; }' | \
|
||||
perl -ne 'while (/\b(?:fixes|closes|resolves|refs?)\s+((?:#[0-9]+\b(?:\s*(?:,|and)?\s*#[0-9]+\b)*))/ig) { print "$1\n"; }' | \
|
||||
grep -oE '#[0-9]+' || true)
|
||||
if [[ -n "$PR_ISSUES" ]]; then
|
||||
ALL_REFERENCED_ISSUES=$(printf '%s\n%s\n' "$ALL_REFERENCED_ISSUES" "$PR_ISSUES")
|
||||
|
||||
Reference in New Issue
Block a user