Skip to content

Remove redundant 'Apply workflow_dispatch overrides' step from build workflows #565

@simonrosenberg

Description

@simonrosenberg

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:

  1. For workflow_dispatch: inputs always have defaults that match the env block
  2. 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:

  • .github/workflows/build-swebench-images.yml
  • Any other workflows using this pattern

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' }}

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions