Skip to content

Commit d45137a

Browse files
authored
fix(ci): export UV_INDEX_STRATEGY to current shell before running uv sync (llamastack#4020)
Fixes latent bug where UV_INDEX_STRATEGY was only exported to GITHUB_ENV but not to the current shell. While this bug doesn't currently affect main (since UV_EXTRA_INDEX_URL is only set on release branches), it's a latent bug that could cause issues if the logic changes in the future or if someone tests with UV_EXTRA_INDEX_URL set. The setup-runner action only exported UV_INDEX_STRATEGY to GITHUB_ENV (for subsequent steps), not to the current shell environment. Since uv sync runs in the same step, it would never see the variable if it were set. This fix adds `export UV_INDEX_STRATEGY=unsafe-best-match` to make the variable available in the current shell before running uv commands. Related: llamastack#4019 (same fix for release-0.3.x where the bug is actively triggered)
1 parent 9340183 commit d45137a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/actions/setup-runner/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ runs:
2929
env:
3030
UV_EXTRA_INDEX_URL: ${{ steps.client-config.outputs.uv-extra-index-url }}
3131
run: |
32-
# Export UV env vars to GITHUB_ENV so they persist across steps
32+
# Export UV env vars for current step and persist to GITHUB_ENV for subsequent steps
3333
if [ -n "$UV_EXTRA_INDEX_URL" ]; then
34+
export UV_INDEX_STRATEGY=unsafe-best-match
3435
echo "UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> $GITHUB_ENV
35-
echo "UV_INDEX_STRATEGY=unsafe-best-match" >> $GITHUB_ENV
36-
echo "Exported UV environment variables for subsequent steps"
36+
echo "UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY" >> $GITHUB_ENV
37+
echo "Exported UV environment variables for current and subsequent steps"
3738
fi
3839
3940
echo "Updating project dependencies via uv sync"

0 commit comments

Comments
 (0)