Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/test-litellm-ui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,35 @@ jobs:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
persist-credentials: false

- name: Detect UI changes
id: changed
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
if git diff --name-only "$BASE_SHA"...HEAD -- . | grep -q .; then
echo "ui_changed=true" >> "$GITHUB_OUTPUT"
else
echo "ui_changed=false" >> "$GITHUB_OUTPUT"
echo "No ui/litellm-dashboard changes in this PR; skipping build."
fi
Comment on lines +32 to +38

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Silent git failure sets ui_changed=false

GitHub Actions uses bash -eo pipefail by default, but if pipeline; then absorbs the pipeline's exit code rather than propagating it as a script error. If git diff were to fail (e.g., BASE_SHA not in the fetched history despite fetch-depth: 0), the pipeline exits non-zero, the else branch fires, and ui_changed=false is written — silently skipping the build even when dashboard files did change. fetch-depth: 0 makes this scenario unlikely, and the existing frontend-lint job uses the same pattern, so this is a minor robustness note rather than a blocking concern.


- name: Setup Node.js
if: steps.changed.outputs.ui_changed == 'true'
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: "20"
cache: "npm"
cache-dependency-path: ui/litellm-dashboard/package-lock.json

- name: Install dependencies
if: steps.changed.outputs.ui_changed == 'true'
run: npm ci

- name: Build
if: steps.changed.outputs.ui_changed == 'true'
run: npm run build

frontend-lint:
Expand Down
Loading