mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
The frontend build workflow and two jobs in the Docker workflow ran with the repository's default token permissions, which GitHub code scanning flags. They now get read-only access, plus read access to the published images for the job that copies them to Docker Hub. Every job in both workflows now runs with explicitly set permissions.
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
# ─────────────────────────────────────────────────────────────────────────────
|
|
# Frontend CI — Lint, format check, build, and unit tests
|
|
# Runs on pushes and PRs to main/dev, skipping backend-only changes
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
name: Frontend Build
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
paths-ignore: ['backend/**', 'pyproject.toml', 'uv.lock']
|
|
pull_request:
|
|
branches: [main, dev]
|
|
paths-ignore: ['backend/**', 'pyproject.toml', 'uv.lock']
|
|
|
|
concurrency:
|
|
group: frontend-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
ONNXRUNTIME_NODE_INSTALL_CUDA: skip
|
|
|
|
jobs:
|
|
# ── Format, i18n, and production build ────────────────────────────────────
|
|
format-and-build:
|
|
name: Format & Build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v5.1.0
|
|
|
|
- uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm install --force
|
|
|
|
- name: Verify code formatting
|
|
run: npm run format
|
|
|
|
- name: Verify i18n strings
|
|
run: npm run i18n:parse
|
|
|
|
- name: Ensure working tree is clean
|
|
run: git diff --exit-code
|
|
|
|
- name: Production build
|
|
run: npm run build
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=8192
|
|
|
|
# ── Vitest unit tests ────────────────────────────────────────────────────
|
|
unit-tests:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v5.1.0
|
|
|
|
- uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies (frozen lockfile)
|
|
run: npm ci --force
|
|
|
|
- name: Execute test suite
|
|
run: npm run test:frontend
|