]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ci : fix github workflow vulnerable to script injection (#9008)
authorDiogo Teles Sant'Anna <redacted>
Mon, 12 Aug 2024 16:28:23 +0000 (13:28 -0300)
committerGitHub <redacted>
Mon, 12 Aug 2024 16:28:23 +0000 (19:28 +0300)
Signed-off-by: Diogo Teles Sant'Anna <redacted>
.github/workflows/bench.yml

index eb69b82c47e643c47ebe9bb2d9b622bc55af8451..56d22bc0cc394d1a2993e64be3b33041b8345ce3 100644 (file)
@@ -129,6 +129,8 @@ jobs:
 
       - name: Server bench
         id: server_bench
+        env:
+            HEAD_REF: ${{ github.head_ref || github.ref_name }}
         run: |
           set -eux
 
@@ -137,7 +139,7 @@ jobs:
           python bench.py \
               --runner-label ${{ env.RUNNER_LABEL }} \
               --name ${{ github.job }} \
-              --branch ${{ github.head_ref || github.ref_name }} \
+              --branch $HEAD_REF \
               --commit ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha }} \
               --scenario script.js \
               --duration ${{ github.event.inputs.duration || env.DURATION }} \