angular-doctor 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,6 +60,116 @@ npx -y angular-doctor@latest . --verbose --diff
60
60
 
61
61
  ---
62
62
 
63
+ ## 🚀 GitHub Actions CI
64
+
65
+ Integrate Angular Doctor into your GitHub CI pipeline to post PR comments with health scores and enforce quality gates.
66
+
67
+ ### Basic Setup
68
+
69
+ ```yaml
70
+ name: Angular Doctor
71
+ on:
72
+ push:
73
+ branches: [main]
74
+ pull_request:
75
+
76
+ jobs:
77
+ angular-doctor:
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+
82
+ - name: Run Angular Doctor
83
+ uses: antonygiomarxdev/angular-doctor@v1.2.0
84
+ with:
85
+ directory: .
86
+ verbose: true
87
+ github-token: ${{ secrets.GITHUB_TOKEN }}
88
+ ```
89
+
90
+ ### With Score Gating
91
+
92
+ Fail the CI build when the score falls below a threshold:
93
+
94
+ ```yaml
95
+ name: Angular Doctor
96
+ on:
97
+ push:
98
+ branches: [main]
99
+ pull_request:
100
+
101
+ jobs:
102
+ angular-doctor:
103
+ runs-on: ubuntu-latest
104
+ steps:
105
+ - uses: actions/checkout@v4
106
+
107
+ - name: Run Angular Doctor
108
+ id: angular-doctor
109
+ uses: antonygiomarxdev/angular-doctor@v1.2.0
110
+ with:
111
+ directory: .
112
+ github-token: ${{ secrets.GITHUB_TOKEN }}
113
+ score-threshold: 75 # Fail if score < 75
114
+
115
+ - name: Use score output
116
+ run: echo "Score: ${{ steps.angular-doctor.outputs.score }}"
117
+ ```
118
+
119
+ ### Diff Mode for PRs
120
+
121
+ Scan only changed files vs the main branch:
122
+
123
+ ```yaml
124
+ name: Angular Doctor
125
+ on:
126
+ push:
127
+ branches: [main]
128
+ pull_request:
129
+
130
+ jobs:
131
+ angular-doctor:
132
+ runs-on: ubuntu-latest
133
+ steps:
134
+ - uses: actions/checkout@v4
135
+ with:
136
+ fetch-depth: 0 # Required for diff mode
137
+
138
+ - name: Run Angular Doctor
139
+ uses: antonygiomarxdev/angular-doctor@v1.2.0
140
+ with:
141
+ directory: .
142
+ diff: main # Compare against main branch
143
+ github-token: ${{ secrets.GITHUB_TOKEN }}
144
+ ```
145
+
146
+ ### Action Inputs
147
+
148
+ | Input | Description | Default |
149
+ |-------|-------------|---------|
150
+ | `directory` | Project directory to scan | `.` |
151
+ | `verbose` | Show file details per rule | `true` |
152
+ | `project` | Workspace project(s) to scan (comma-separated) | — |
153
+ | `diff` | Base branch for diff mode | — |
154
+ | `github-token` | GitHub token for posting PR comments | — |
155
+ | `score-threshold` | Exit with error code when score is below threshold | `0` |
156
+ | `node-version` | Node.js version to use | `20` |
157
+
158
+ ### Action Outputs
159
+
160
+ | Output | Description |
161
+ |--------|-------------|
162
+ | `score` | Health score (0-100) |
163
+ | `label` | Score label (Great, Needs work, Critical) |
164
+
165
+ ### PR Comment Example
166
+
167
+ When `github-token` is provided on pull request events, Angular Doctor posts a comment like:
168
+
169
+ ![PR Comment](docs/assets/pr-comment.png)
170
+
171
+ ---
172
+
63
173
  ## 🧭 Workspace support
64
174
 
65
175
  Angular Doctor automatically detects multiple projects: