Fail PR if Warnings are present in React Code (#1348)
This commit is contained in:
17
.github/workflows/react-no-warnings.yml
vendored
Normal file
17
.github/workflows/react-no-warnings.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: "React Code Has No Warnings"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install modules
|
||||||
|
working-directory: ./portal-ui
|
||||||
|
run: yarn
|
||||||
|
- name: Check for Warnings in build output
|
||||||
|
working-directory: ./portal-ui
|
||||||
|
continue-on-error: false
|
||||||
|
run: |
|
||||||
|
chmod +x check-warnings.sh && ./check-warnings.sh
|
||||||
@@ -4,3 +4,5 @@ build-static:
|
|||||||
@echo "Building frontend static assets to 'build'"
|
@echo "Building frontend static assets to 'build'"
|
||||||
NODE_OPTIONS=--openssl-legacy-provider yarn build
|
NODE_OPTIONS=--openssl-legacy-provider yarn build
|
||||||
|
|
||||||
|
test-warnings:
|
||||||
|
./check-warnings.sh
|
||||||
|
|||||||
6
portal-ui/check-warnings.sh
Executable file
6
portal-ui/check-warnings.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if yarn build | grep "Compiled with warnings"; then
|
||||||
|
echo "There are warnings in the code"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -86,7 +86,7 @@ const QueryMultiSelector = ({
|
|||||||
// Use effect to get the initial values from props
|
// Use effect to get the initial values from props
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
currentKeys.length === 1 &&
|
currentKeys.length == 1 &&
|
||||||
currentKeys[0] === "" &&
|
currentKeys[0] === "" &&
|
||||||
currentValues.length === 1 &&
|
currentValues.length === 1 &&
|
||||||
currentValues[0] === "" &&
|
currentValues[0] === "" &&
|
||||||
|
|||||||
Reference in New Issue
Block a user