1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

run npm lint when open PR (#6375)

* 01 fix code warnings

* 02 change test.yml
This commit is contained in:
Michael An
2024-07-19 11:14:28 +08:00
committed by GitHub
parent c3b9b96ed9
commit 88dc8d0cac
10 changed files with 72 additions and 30 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -e
set -x
if test $GITHUB_EVENT_NAME = "pull_request"; then
branch=$GITHUB_HEAD_REF
else
branch=${GITHUB_REF##*/}
fi
export GITHUB_BRANCH=$branch
echo "GITHUB_BRANCH: $GITHUB_BRANCH"
export PYTHONPATH="${PYTHONPATH}:/tmp/site-packages"
echo "PYTHONPATH: $PYTHONPATH"
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >~/.npmrc
cd $GITHUB_WORKSPACE
echo "npm run lint on frontend/src files..."
cd ./frontend && npm install && npm run lint