This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 0e42635732 [Chore] Improve frontend ci check (#16335)
0e42635732 is described below
commit 0e426357324a66138fe3149dc87a82023baabc54
Author: xiangzihao <[email protected]>
AuthorDate: Wed Jul 17 22:44:03 2024 +0800
[Chore] Improve frontend ci check (#16335)
* improve frontend ci check
---
.github/workflows/frontend.yml | 9 ++++++++-
.../src/views/resource/components/resource/edit/index.tsx | 2 +-
.../src/views/resource/components/resource/edit/use-edit.ts | 5 ++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index 1cb5f5a84b..d830c478b5 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -69,12 +69,19 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16
- - name: Compile and Build on ${{ matrix.os }}
+ - name: Code Format Check
run: |
set -x
npm install pnpm@7 -g
pnpm install
pnpm run lint
+ modified_files=$(git status | grep modified | wc -l)
+ if [ $modified_files -gt 0 ]; then
+ echo "Code format check failed! Please run \`pnpm run lint\` to
format the code."
+ exit -1
+ fi
+ - name: Compile and Build on ${{ matrix.os }}
+ run: |
pnpm run build:prod
result:
name: Frontend Build
diff --git
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
index fed715e59b..2b65c18bd4 100644
--- a/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
+++ b/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
@@ -24,7 +24,7 @@ import { useEdit, useIsDetailPageStore } from './use-edit'
import Card from '@/components/card'
import MonacoEditor from '@/components/monaco-editor'
import styles from '../index.module.scss'
-import { useDetailPageStore } from
"@/views/resource/components/resource/table/use-table";
+import { useDetailPageStore } from
'@/views/resource/components/resource/table/use-table'
export default defineComponent({
name: 'ResourceEdit',
diff --git
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
index ffaa6b8f74..2ec97926b3 100644
---
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
+++
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
@@ -19,7 +19,10 @@ import { useI18n } from 'vue-i18n'
import type { Router } from 'vue-router'
import { useRouter } from 'vue-router'
import { useAsyncState } from '@vueuse/core'
-import { updateResourceContent, viewResource } from
'@/service/modules/resources'
+import {
+ updateResourceContent,
+ viewResource
+} from '@/service/modules/resources'
import { defineStore } from 'pinia'
export function useEdit(state: any) {