Problem
Several build workflows have a redundant pattern: an env: block with hardcoded defaults, followed by an "Apply workflow_dispatch overrides" step that copies inputs.* values into GITHUB_ENV. This override step is effectively a no-op because:
- For
workflow_dispatch: inputs always have defaults that match the env block
- For
pull_request_target: the step is skipped entirely (gated by if: workflow_dispatch)
The duplication is error-prone — if someone updates the input default without updating the env default (or vice versa), they silently diverge.
Fix
Replace hardcoded env defaults with ${{ inputs.X || 'default' }} expressions. For pull_request_target, inputs are empty so the || fallback applies. For workflow_dispatch, the input value is used directly. This eliminates the need for the separate override step.
This was already done for build-swtbench-images.yml in PR #555. The same cleanup should be applied to:
Example
Before:
env:
DATASET: 'princeton-nlp/SWE-bench_Verified'
# ...
steps:
- name: Apply workflow_dispatch overrides (if any)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
if [ -n "${{ inputs.dataset }}" ]; then echo "DATASET=${{ inputs.dataset }}" >> "$GITHUB_ENV"; fi
After:
env:
DATASET: ${{ inputs.dataset || 'princeton-nlp/SWE-bench_Verified' }}
Problem
Several build workflows have a redundant pattern: an
env:block with hardcoded defaults, followed by an "Apply workflow_dispatch overrides" step that copiesinputs.*values intoGITHUB_ENV. This override step is effectively a no-op because:workflow_dispatch: inputs always have defaults that match the env blockpull_request_target: the step is skipped entirely (gated byif: workflow_dispatch)The duplication is error-prone — if someone updates the input default without updating the env default (or vice versa), they silently diverge.
Fix
Replace hardcoded env defaults with
${{ inputs.X || 'default' }}expressions. Forpull_request_target, inputs are empty so the||fallback applies. Forworkflow_dispatch, the input value is used directly. This eliminates the need for the separate override step.This was already done for
build-swtbench-images.ymlin PR #555. The same cleanup should be applied to:.github/workflows/build-swebench-images.ymlExample
Before:
After: