فهرست منبع

ci : fix github workflow vulnerable to script injection (#9008)

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
Diogo Teles Sant'Anna 1 سال پیش
والد
کامیت
fc4ca27b25
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      .github/workflows/bench.yml

+ 3 - 1
.github/workflows/bench.yml

@@ -129,6 +129,8 @@ jobs:
 
 
       - name: Server bench
       - name: Server bench
         id: server_bench
         id: server_bench
+        env:
+            HEAD_REF: ${{ github.head_ref || github.ref_name }}
         run: |
         run: |
           set -eux
           set -eux
 
 
@@ -137,7 +139,7 @@ jobs:
           python bench.py \
           python bench.py \
               --runner-label ${{ env.RUNNER_LABEL }} \
               --runner-label ${{ env.RUNNER_LABEL }} \
               --name ${{ github.job }} \
               --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 }} \
               --commit ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha }} \
               --scenario script.js \
               --scenario script.js \
               --duration ${{ github.event.inputs.duration || env.DURATION }} \
               --duration ${{ github.event.inputs.duration || env.DURATION }} \