Skip to content

Commit 2f063a7

Browse files
authored
Merge pull request #13052 from RinZ27/fix/ci-shell-injection
ci: fix shell injection in backport workflow
2 parents 77d62de + 7dc3828 commit 2f063a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/backport-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- name: Get backport metadata
2727
# the target branch is the first argument after `/backport`
28+
env:
29+
COMMENT_BODY: ${{ github.event.comment.body }}
2830
run: |
2931
set -euo pipefail
30-
body="${{ github.event.comment.body }}"
32+
body="$COMMENT_BODY"
3133
3234
line=${body%%$'\n'*} # Get the first line
3335
if [[ $line =~ ^/backport[[:space:]]+([^[:space:]]+) ]]; then

0 commit comments

Comments
 (0)