Add JS linting and deploy gating to CI pipeline
Lint / Python (flake8) (push) Successful in 20s
Lint / JS (eslint) (push) Successful in 8s
Lint / Deploy (push) Successful in 2s

- Add js-lint job (ESLint 8) for static/ directory
- Add deploy job gated on both python-lint and js-lint passing
- Deploy triggers gandalf-deploy webhook on main branch only
- Add static/.eslintrc.json with browser env config
- Add node_modules/ to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 10:14:33 -04:00
parent 28fb5c666c
commit 963ceb3e1e
5 changed files with 1192 additions and 1 deletions
+32
View File
@@ -21,3 +21,35 @@ jobs:
- name: Run flake8
run: flake8 . --exclude=__pycache__,.git
js-lint:
name: JS (eslint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ESLint
run: npm install --save-dev eslint@8
- name: Run ESLint
run: npx eslint --ext .js static/
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [python-lint, js-lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Trigger webhook
env:
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
GIT_REF: ${{ github.ref }}
run: |
PAYLOAD="{\"ref\":\"${GIT_REF}\"}"
SIG=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | awk '{print $2}')
curl -sf --connect-timeout 10 \
-X POST \
-H "Content-Type: application/json" \
-H "X-Gitea-Signature: ${SIG}" \
-d "$PAYLOAD" \
"http://10.10.10.61:9000/hooks/gandalf-deploy"
+2 -1
View File
@@ -1,4 +1,5 @@
log.txt
config.json
__pycache__/
*.pyc
*.pyc
node_modules/
+1140
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
{
"devDependencies": {
"eslint": "^8.57.1"
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"env": { "browser": true, "es2021": true },
"extends": "eslint:recommended",
"parserOptions": { "ecmaVersion": 2021, "sourceType": "script" },
"rules": {
"no-unused-vars": "warn",
"no-undef": "off",
"no-empty": "warn",
"no-inner-declarations": "warn",
"semi": ["error", "always"],
"eqeqeq": "warn"
}
}