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:
26
tests/github_actions_npm_lint.sh
Normal file
26
tests/github_actions_npm_lint.sh
Normal 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
|
Reference in New Issue
Block a user