forked from millionco/react-doctor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
50 lines (45 loc) · 1.36 KB
/
action.yml
File metadata and controls
50 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: "React Doctor"
description: "Scan React codebases for security, performance, and correctness issues"
branding:
icon: "activity"
color: "blue"
inputs:
directory:
description: "Project directory to scan"
default: "."
verbose:
description: "Show file details per rule"
default: "true"
project:
description: "Workspace project(s) to scan (comma-separated)"
required: false
node-version:
description: "Node.js version to use"
default: "20"
outputs:
score:
description: "Health score (0-100)"
value: ${{ steps.score.outputs.score }}
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- shell: bash
env:
INPUT_DIRECTORY: ${{ inputs.directory }}
INPUT_VERBOSE: ${{ inputs.verbose }}
INPUT_PROJECT: ${{ inputs.project }}
run: |
FLAGS=""
if [ "$INPUT_VERBOSE" = "true" ]; then FLAGS="$FLAGS --verbose"; fi
if [ -n "$INPUT_PROJECT" ]; then FLAGS="$FLAGS --project $INPUT_PROJECT"; fi
npx -y react-doctor@latest "$INPUT_DIRECTORY" $FLAGS
- id: score
shell: bash
env:
INPUT_DIRECTORY: ${{ inputs.directory }}
run: |
SCORE=$(npx -y react-doctor@latest "$INPUT_DIRECTORY" --score 2>/dev/null || echo "")
echo "score=$SCORE" >> "$GITHUB_OUTPUT"