From 7e9a0e7b01257363c081444fecfd294001b54aac Mon Sep 17 00:00:00 2001 From: Reza Rezvani Date: Wed, 12 Nov 2025 14:33:10 +0100 Subject: [PATCH] fix(ci): handle multi-line PR body in linked issues check Use heredoc to safely write PR body to temp file instead of storing in variable. This prevents bash from interpreting special characters and multi-line content as commands (exit code 127 error). Fixes workflow failure in PR #3. --- .github/workflows/pr-into-dev.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-into-dev.yml b/.github/workflows/pr-into-dev.yml index e0a5765..c60d99f 100644 --- a/.github/workflows/pr-into-dev.yml +++ b/.github/workflows/pr-into-dev.yml @@ -80,14 +80,18 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | PR_NUMBER="${{ github.event.pull_request.number }}" - PR_BODY="${{ github.event.pull_request.body }}" echo "Checking for linked issues in PR #$PR_NUMBER" + # Write PR body to temp file to handle multi-line content safely + cat > /tmp/pr_body.txt << 'EOF' + ${{ github.event.pull_request.body }} + EOF + # Check for keywords like "Closes", "Fixes", "Resolves", "Relates to" ISSUE_KEYWORDS="Closes|Fixes|Resolves|Relates to|Ref|References" - if echo "$PR_BODY" | grep -qiE "($ISSUE_KEYWORDS) #[0-9]+"; then + if grep -qiE "($ISSUE_KEYWORDS) #[0-9]+" /tmp/pr_body.txt; then echo "✅ Found linked issue(s) in PR body" echo "has-linked-issues=true" >> $GITHUB_OUTPUT else