添加自动映射端口并尝试添加工作流
This commit is contained in:
41
.gitea/workflows/lint.yaml
Normal file
41
.gitea/workflows/lint.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Code Linting
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint JavaScript Code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check for syntax errors
|
||||
run: node -c server.js
|
||||
|
||||
- name: Run ESLint (if configured)
|
||||
run: |
|
||||
if [ -f ".eslintrc.json" ] || [ -f ".eslintrc.js" ] || [ -f "eslint.config.js" ]; then
|
||||
npx eslint . --ext .js
|
||||
else
|
||||
echo "ESLint not configured, skipping..."
|
||||
fi
|
||||
continue-on-error: true
|
||||
Reference in New Issue
Block a user