Skip to content

Commit 90af509

Browse files
authored
🤖 fix: use shell script for artifact name instead of replace() (#490)
## Problem PR #488 introduced a syntax error by using the `replace()` function in a GitHub Actions workflow expression: ```yaml name: terminal-bench-results-${{ inputs.model_name && replace(format('{0}-{1}', inputs.model_name, github.run_id), ':', '-') || format('{0}', github.run_id) }} ``` **GitHub Actions does not support `replace()` as a function in workflow expressions.** This caused the nightly workflow to fail with a syntax error. ## Solution Use a shell script step to compute the artifact name using the `tr` command: ```yaml - name: Set artifact name id: artifact-name run: | if [ -n "${{ inputs.model_name }}" ]; then ARTIFACT_NAME="terminal-bench-results-$(echo "${{ inputs.model_name }}-${{ github.run_id }}" | tr ':' '-')" else ARTIFACT_NAME="terminal-bench-results-${{ github.run_id }}" fi echo "name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT - name: Upload benchmark results uses: actions/upload-artifact@v4 with: name: ${{ steps.artifact-name.outputs.name }} ``` This uses standard shell string manipulation which is fully supported. ## Testing The workflow syntax now validates correctly. The next nightly run should: - ✅ Parse successfully without syntax errors - ✅ Replace colons with hyphens: `anthropic-claude-sonnet-4-5` - ✅ Upload artifacts with valid names --- _Generated with `cmux`_
1 parent cd58afa commit 90af509

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/terminal-bench.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,24 @@ jobs:
126126
ls -la runs/
127127
fi
128128
129+
- name: Set artifact name
130+
if: always()
131+
id: artifact-name
132+
run: |
133+
if [ -n "${{ inputs.model_name }}" ]; then
134+
# Replace colons with hyphens for filesystem compatibility
135+
ARTIFACT_NAME="terminal-bench-results-$(echo "${{ inputs.model_name }}-${{ github.run_id }}" | tr ':' '-')"
136+
else
137+
ARTIFACT_NAME="terminal-bench-results-${{ github.run_id }}"
138+
fi
139+
echo "name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
140+
echo "Artifact name: $ARTIFACT_NAME"
141+
129142
- name: Upload benchmark results
130143
if: always()
131144
uses: actions/upload-artifact@v4
132145
with:
133-
# Replace colons with hyphens to avoid GitHub artifact name restrictions
134-
name: terminal-bench-results-${{ inputs.model_name && replace(format('{0}-{1}', inputs.model_name, github.run_id), ':', '-') || format('{0}', github.run_id) }}
146+
name: ${{ steps.artifact-name.outputs.name }}
135147
path: |
136148
runs/
137149
if-no-files-found: warn

0 commit comments

Comments
 (0)