ci: read the PR body from env instead of interpolating it into the shell (#4880)

This commit is contained in:
Kobi Hikri
2026-07-28 14:11:17 -05:00
committed by GitHub
parent d790118546
commit 5f37ef4a80
@@ -18,10 +18,11 @@ jobs:
- name: Extract Discussion Number & Close If any Were Found - name: Extract Discussion Number & Close If any Were Found
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true
id: extract-discussion id: extract-discussion
run: | run: |
pr_body="${{ github.event.pull_request.body }}" pr_body="$PR_BODY"
discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+') discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+')
if [ -z "$discussion_ids" ]; then if [ -z "$discussion_ids" ]; then