mirror of
https://github.com/alirezarezvani/ClaudeForge.git
synced 2026-07-03 10:23:15 -04:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user