mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-11 19:56:03 +00:00
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.
This commit is contained in:
parent
b8892de5d6
commit
7867a08711
1 changed files with 11 additions and 2 deletions
13
.github/workflows/pre-commit.yml
vendored
13
.github/workflows/pre-commit.yml
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue