Skip to content

Commit 0b27de9

Browse files
committed
CODE RUB: Update Build Script
1 parent 92834aa commit 0b27de9

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/prLinter.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,17 @@ jobs:
111111
- name: Check For Associated Issues Or Tasks
112112
id: check_for_issues_or_tasks
113113
if: ${{ steps.get_pr_info.outputs.prOwner != 'dependabot[bot]' }}
114+
env:
115+
PR_BODY: ${{ steps.get_pr_info.outputs.description }}
114116
run: >2-
115-
PR_BODY="${{ steps.get_pr_info.outputs.description }}"
116-
echo "::notice::Raw PR Body: $PR_BODY"
117-
118-
if [[ -z "$PR_BODY" ]]; then
117+
if [[ -z "${PR_BODY:-}" ]]; then
119118
echo "Error: PR description does not contain any links to issue(s)/task(s) (e.g., 'closes #123' / 'closes AB#123' / 'fixes #123' / 'fixes AB#123')."
120119
exit 1
121120
fi
122121
123-
PR_BODY=$(echo "$PR_BODY" | tr -s '\r\n' ' ' | tr '\n' ' ' | xargs)
124-
echo "::notice::Normalized PR Body: $PR_BODY"
122+
NORMALIZED_PR_BODY=$(printf '%s' "$PR_BODY" | tr '\r\n' ' ' | tr -s ' ')
125123
126-
if echo "$PR_BODY" | grep -Piq "((close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[#\d+\]|\#\d+)|(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[AB#\d+\]|AB#\d+))"; then
124+
if printf '%s' "$NORMALIZED_PR_BODY" | grep -Piq "(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[#[0-9]+\]|#[0-9]+|\[AB#[0-9]+\]|AB#[0-9]+)"; then
127125
echo "Valid PR description."
128126
else
129127
echo "Error: PR description does not contain any links to issue(s)/task(s) (e.g., 'closes #123' / 'closes AB#123' / 'fixes #123' / 'fixes AB#123')."

0 commit comments

Comments
 (0)