Skip to content

Commit 3e1ee83

Browse files
alexeyrclaude
andcommitted
Drop dead matrix job outputs and harden workflow step inputs
- Remove the unused run_*_benchmarks detect-changes outputs; after the matrix unification no downstream job consumes them (only step-local env does). - Route matrix/context values through env: in the Execute and Summary steps so the shell treats them as data, not code (GitHub Actions injection hardening). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 532aff5 commit 3e1ee83

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ jobs:
9191
runs-on: ubuntu-24.04
9292
outputs:
9393
non_runtime_only: ${{ steps.detect.outputs.non_runtime_only }}
94-
run_core_benchmarks: ${{ steps.benchmark-outputs.outputs.run_core_benchmarks }}
95-
run_pro_benchmarks: ${{ steps.benchmark-outputs.outputs.run_pro_benchmarks }}
96-
run_pro_node_renderer_benchmarks: ${{ steps.benchmark-outputs.outputs.run_pro_node_renderer_benchmarks }}
9794
run_benchmark_suites: ${{ steps.benchmark-matrices.outputs.run_benchmark_suites }}
9895
benchmark_matrix: ${{ steps.benchmark-matrices.outputs.benchmark_matrix }}
9996
steps:
@@ -437,16 +434,23 @@ jobs:
437434
438435
- name: Execute benchmark suite
439436
timeout-minutes: ${{ matrix.benchmark_timeout_minutes }}
437+
# Route matrix values through env so the shell treats them as data, not code
438+
# (GitHub Actions injection hardening), even though they come from our own
439+
# generate_matrix.rb.
440+
env:
441+
SUITE_NAME: ${{ matrix.suite_name }}
442+
PRO_ENV: ${{ matrix.pro_env }}
443+
BENCHMARK_SCRIPT: ${{ matrix.benchmark_script }}
440444
run: |
441445
set -e
442-
echo "🏃 Running ${{ matrix.suite_name }} benchmark suite..."
446+
echo "🏃 Running $SUITE_NAME benchmark suite..."
443447
444-
if [ "${{ matrix.pro_env }}" = "true" ]; then
445-
if ! PRO=true $BENCH_CMD "${{ matrix.benchmark_script }}"; then
448+
if [ "$PRO_ENV" = "true" ]; then
449+
if ! PRO=true $BENCH_CMD "$BENCHMARK_SCRIPT"; then
446450
echo "❌ ERROR: Benchmark execution failed"
447451
exit 1
448452
fi
449-
elif ! $BENCH_CMD "${{ matrix.benchmark_script }}"; then
453+
elif ! $BENCH_CMD "$BENCHMARK_SCRIPT"; then
450454
echo "❌ ERROR: Benchmark execution failed"
451455
exit 1
452456
fi
@@ -501,12 +505,21 @@ jobs:
501505

502506
- name: Benchmark workflow summary
503507
if: always()
508+
# Route context/matrix values through env so the shell treats them as data,
509+
# not code (GitHub Actions injection hardening; ref_name can be attacker-set).
510+
env:
511+
SUITE_NAME: ${{ matrix.suite_name }}
512+
SHARD_LABEL: ${{ matrix.shard_label }}
513+
JOB_STATUS: ${{ job.status }}
514+
RUN_NUMBER: ${{ github.run_number }}
515+
ACTOR: ${{ github.actor }}
516+
REF_NAME: ${{ github.ref_name }}
504517
run: |
505518
echo "📋 Benchmark Workflow Summary"
506519
echo "===================================="
507-
echo "Suite: ${{ matrix.suite_name }}"
508-
echo "Shard: ${{ matrix.shard_label }}"
509-
echo "Status: ${{ job.status }}"
510-
echo "Run number: ${{ github.run_number }}"
511-
echo "Triggered by: ${{ github.actor }}"
512-
echo "Branch: ${{ github.ref_name }}"
520+
echo "Suite: $SUITE_NAME"
521+
echo "Shard: $SHARD_LABEL"
522+
echo "Status: $JOB_STATUS"
523+
echo "Run number: $RUN_NUMBER"
524+
echo "Triggered by: $ACTOR"
525+
echo "Branch: $REF_NAME"

0 commit comments

Comments
 (0)