Skip to content

Commit fc4ca27

Browse files
authored
ci : fix github workflow vulnerable to script injection (ggml-org#9008)
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
1 parent 1f67436 commit fc4ca27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/bench.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ jobs:
129129
130130
- name: Server bench
131131
id: server_bench
132+
env:
133+
HEAD_REF: ${{ github.head_ref || github.ref_name }}
132134
run: |
133135
set -eux
134136
@@ -137,7 +139,7 @@ jobs:
137139
python bench.py \
138140
--runner-label ${{ env.RUNNER_LABEL }} \
139141
--name ${{ github.job }} \
140-
--branch ${{ github.head_ref || github.ref_name }} \
142+
--branch $HEAD_REF \
141143
--commit ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha }} \
142144
--scenario script.js \
143145
--duration ${{ github.event.inputs.duration || env.DURATION }} \

0 commit comments

Comments
 (0)