1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-19 09:37:51 +00:00
seahub/tests/github_actions_npm_lint.sh
Michael An 88dc8d0cac
run npm lint when open PR (#6375)
* 01 fix code warnings

* 02 change test.yml
2024-07-19 11:14:28 +08:00

27 lines
473 B
Bash

#!/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