Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor: add ts common style check for web and cli (#36823)

Yunlu Wen4939a9c33d0f
diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml
index c40ca5c1eac..e18607a60ea 100644
--- a/.github/workflows/style.yml
+++ b/.github/workflows/style.yml
@@ -95,6 +95,51 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
uses: ./.github/actions/setup-web
+ - name: Web tsslint
+ if: steps.changed-files.outputs.any_changed == 'true'
+ env:
+ NODE_OPTIONS: --max-old-space-size=4096
+ run: vp run lint:tss
+
+ - name: Web dead code check
+ if: steps.changed-files.outputs.any_changed == 'true'
+ run: vp run knip
+
+ ts-common-style:
+ name: TS Common
+ runs-on: depot-ubuntu-24.04
+ permissions:
+ checks: write
+ pull-requests: read
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Check changed files
+ id: changed-files
+ uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
+ with:
+ files: |
+ web/**
+ cli/**
+ e2e/**
+ sdks/nodejs-client/**
+ packages/**
+ package.json
+ pnpm-lock.yaml
+ pnpm-workspace.yaml
+ .nvmrc
+ eslint.config.mjs
+ .github/workflows/style.yml
+ .github/actions/setup-web/**
+
+ - name: Setup web environment
+ if: steps.changed-files.outputs.any_changed == 'true'
+ uses: ./.github/actions/setup-web
+
- name: Restore ESLint cache
if: steps.changed-files.outputs.any_changed == 'true'
id: eslint-cache-restore
@@ -105,28 +150,14 @@ jobs:
restore-keys: |
${{ runner.os }}-eslint-${{ hashFiles('pnpm-lock.yaml', 'eslint.config.mjs', 'web/eslint.config.mjs', 'web/eslint.constants.mjs', 'web/plugins/eslint/**') }}-
- - name: Web style check
+ - name: Style check
if: steps.changed-files.outputs.any_changed == 'true'
- working-directory: .
run: vp run lint:ci
- - name: Web tsslint
+ - name: Type check
if: steps.changed-files.outputs.any_changed == 'true'
- working-directory: ./web
- env:
- NODE_OPTIONS: --max-old-space-size=4096
- run: vp run lint:tss
-
- - name: Web type check
- if: steps.changed-files.outputs.any_changed == 'true'
- working-directory: .
run: vp run type-check
- - name: Web dead code check
- if: steps.changed-files.outputs.any_changed == 'true'
- working-directory: ./web
- run: vp run knip
-
- name: Save ESLint cache
if: steps.changed-files.outputs.any_changed == 'true' && success() && steps.eslint-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5