ci: fix shell injection in backport workflow
This commit is contained in:
parent
77d62deeed
commit
7dc38286c0
1 changed files with 3 additions and 1 deletions
4
.github/workflows/backport-pr.yml
vendored
4
.github/workflows/backport-pr.yml
vendored
|
|
@ -25,9 +25,11 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Get backport metadata
|
- name: Get backport metadata
|
||||||
# the target branch is the first argument after `/backport`
|
# the target branch is the first argument after `/backport`
|
||||||
|
env:
|
||||||
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
body="${{ github.event.comment.body }}"
|
body="$COMMENT_BODY"
|
||||||
|
|
||||||
line=${body%%$'\n'*} # Get the first line
|
line=${body%%$'\n'*} # Get the first line
|
||||||
if [[ $line =~ ^/backport[[:space:]]+([^[:space:]]+) ]]; then
|
if [[ $line =~ ^/backport[[:space:]]+([^[:space:]]+) ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue