From 7867a087112e0e07fb11d7a133cba0ea3ce5e4a6 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 31 Oct 2025 06:40:43 -0700 Subject: [PATCH] fix: export UV env vars to GITHUB_ENV for pre-commit hooks Pre-commit hooks run in isolated environments and don't inherit env vars from the workflow step. Export UV_INDEX_URL and UV_EXTRA_INDEX_URL to GITHUB_ENV so they're available to all subsequent steps and their subprocesses, including pre-commit hooks. --- .github/workflows/pre-commit.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c907a992a..fed2db800 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -53,13 +53,22 @@ jobs: id: client-config-precommit uses: ./.github/actions/install-llama-stack-client + - name: Export UV environment variables + run: | + if [ -n "${{ steps.client-config-precommit.outputs.uv-index-url }}" ]; then + echo "UV_INDEX_URL=${{ steps.client-config-precommit.outputs.uv-index-url }}" >> $GITHUB_ENV + echo "Setting UV_INDEX_URL to ${{ steps.client-config-precommit.outputs.uv-index-url }}" + fi + if [ -n "${{ steps.client-config-precommit.outputs.uv-extra-index-url }}" ]; then + echo "UV_EXTRA_INDEX_URL=${{ steps.client-config-precommit.outputs.uv-extra-index-url }}" >> $GITHUB_ENV + echo "Setting UV_EXTRA_INDEX_URL to ${{ steps.client-config-precommit.outputs.uv-extra-index-url }}" + fi + - name: Run pre-commit id: precommit uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 continue-on-error: true env: - UV_INDEX_URL: ${{ steps.client-config-precommit.outputs.uv-index-url }} - UV_EXTRA_INDEX_URL: ${{ steps.client-config-precommit.outputs.uv-extra-index-url }} SKIP: no-commit-to-branch RUFF_OUTPUT_FORMAT: github