Skip to content

Commit b065cf0

Browse files
yarikopticclaude
andcommitted
CI: fix PR body parsing to handle special characters
Use heredoc to safely handle PR body content that may contain: - Quotes (single and double) - Newlines and multiline text - Special bash characters 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b83dbe5 commit b065cf0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/validate_datasets.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ jobs:
3535
- name: Check for bids-specification PR reference
3636
id: find-pr
3737
run: |
38-
# Also check PR description if this is a PR
38+
# Check PR description if this is a PR
3939
if [ "${{ github.event_name }}" == "pull_request" ]; then
40-
PR_NUM=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'bids-specification-pr:\s*(https://github\.com/bids-standard/bids-specification/pulls?/)*\K[0-9]+' | head -1 || true)
40+
cat << 'EOF' > /tmp/pr_body.txt
41+
${{ github.event.pull_request.body }}
42+
EOF
43+
PR_NUM=$(grep -oP 'bids-specification-pr:\s*(https://github\.com/bids-standard/bids-specification/pulls?/)*\K[0-9]+' /tmp/pr_body.txt | head -1 || true)
4144
[ -n "$PR_NUM" ] && echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT
4245
fi
4346

0 commit comments

Comments
 (0)