Commit 90af509
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
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
129 | 142 | | |
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
133 | | - | |
134 | | - | |
| 146 | + | |
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
| |||
0 commit comments