Skip to content

fix type lint to resolve build error #42

fix type lint to resolve build error

fix type lint to resolve build error #42

Workflow file for this run

name: Code Check
on:
push:
branches: [main]
paths:
- 'dify-helm-watchdog/**'
- '.github/workflows/**'
pull_request:
branches: [main]
paths:
- 'dify-helm-watchdog/**'
- '.github/workflows/**'
jobs:
lint-and-build:
name: Lint & Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dify-helm-watchdog
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'dify-helm-watchdog/yarn.lock'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn lint
- name: Run TypeScript type check
run: yarn tsc --noEmit
- name: Build project
run: yarn build
env:
# 使用示例环境变量,构建时不需要实际的 Blob token
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN || 'dummy-token-for-build' }}
ENABLE_LOCAL_MODE: 'true'
- name: Check build output
run: |
if [ ! -d ".next" ]; then
echo "❌ Build failed: .next directory not found"
exit 1
fi
echo "✅ Build successful!"
ls -lah .next
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: build-output-node-${{ matrix.node-version }}
path: dify-helm-watchdog/.next
retention-days: 7
compression-level: 9