-
Notifications
You must be signed in to change notification settings - Fork 138
317 lines (285 loc) · 8.52 KB
/
pr-validation.yml
File metadata and controls
317 lines (285 loc) · 8.52 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
name: PR Validation
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- develop
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
# Minimal permissions for security
permissions:
contents: read
jobs:
spell-check:
name: Spell Check
uses: ./.github/workflows/spell-check.yml
permissions:
contents: read
with:
soft-fail: false
markdown-lint:
name: Markdown Lint
uses: ./.github/workflows/markdown-lint.yml
permissions:
contents: read
with:
soft-fail: false
table-format:
name: Table Format Check
uses: ./.github/workflows/table-format.yml
permissions:
contents: read
with:
soft-fail: false
psscriptanalyzer:
name: PowerShell Lint
uses: ./.github/workflows/ps-script-analyzer.yml
permissions:
contents: read
with:
soft-fail: false
changed-files-only: true
discover-python-projects:
name: Discover Python Projects
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
directories: ${{ steps.find.outputs.directories }}
has-projects: ${{ steps.find.outputs.has-projects }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
with:
persist-credentials: false
- name: Find Python projects
id: find
shell: pwsh
run: |
$projectList = @(Get-ChildItem -Recurse -Force -Filter pyproject.toml |
Where-Object { $_.FullName -notmatch 'node_modules' } |
ForEach-Object { Resolve-Path -Relative $_.DirectoryName } |
ForEach-Object { $_ -replace '^\.[\\/]', '' } |
Sort-Object)
$jsonItems = $projectList | ForEach-Object { $_ | ConvertTo-Json -Compress }
$dirs = '[' + (($jsonItems) -join ',') + ']'
"directories=$dirs" >> $env:GITHUB_OUTPUT
if ($projectList.Count -eq 0) {
"has-projects=false" >> $env:GITHUB_OUTPUT
Write-Output 'No Python projects found'
} else {
"has-projects=true" >> $env:GITHUB_OUTPUT
Write-Output "Found Python projects: $dirs"
}
python-lint:
name: "Python Lint (${{ matrix.directory }})"
needs: discover-python-projects
if: needs.discover-python-projects.outputs.has-projects == 'true'
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.discover-python-projects.outputs.directories) }}
uses: ./.github/workflows/python-lint.yml
permissions:
contents: read
with:
soft-fail: false
changed-files-only: true
working-directory: ${{ matrix.directory }}
copyright-headers:
name: Copyright Headers
uses: ./.github/workflows/copyright-headers.yml
permissions:
contents: read
with:
soft-fail: false
yaml-lint:
name: YAML Lint
uses: ./.github/workflows/yaml-lint.yml
permissions:
contents: read
with:
soft-fail: false
changed-files-only: true
pester-tests:
name: PowerShell Tests
uses: ./.github/workflows/pester-tests.yml
permissions:
contents: read
id-token: write
with:
soft-fail: false
changed-files-only: false
code-coverage: true
pytest:
name: "Python Tests (${{ matrix.directory }})"
needs: discover-python-projects
if: needs.discover-python-projects.outputs.has-projects == 'true'
uses: ./.github/workflows/pytest-tests.yml
permissions:
contents: read
id-token: write
with:
working-directory: ${{ matrix.directory }}
soft-fail: false
changed-files-only: true
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.discover-python-projects.outputs.directories) }}
fuzz-tests:
name: "Fuzz Tests (${{ matrix.directory }})"
needs: discover-python-projects
if: needs.discover-python-projects.outputs.has-projects == 'true'
uses: ./.github/workflows/fuzz-tests.yml
permissions:
contents: read
with:
working-directory: ${{ matrix.directory }}
soft-fail: false
changed-files-only: true
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.discover-python-projects.outputs.directories) }}
pip-audit:
name: "pip-audit (${{ matrix.directory }})"
needs: discover-python-projects
if: needs.discover-python-projects.outputs.has-projects == 'true'
strategy:
fail-fast: false
matrix:
directory: ${{ fromJson(needs.discover-python-projects.outputs.directories) }}
uses: ./.github/workflows/pip-audit.yml
permissions:
contents: read
with:
working-directory: ${{ matrix.directory }}
soft-fail: false
changed-files-only: true
docusaurus-tests:
name: Docusaurus Tests
uses: ./.github/workflows/docusaurus-tests.yml
permissions:
contents: read
with:
soft-fail: false
frontmatter-validation:
name: Frontmatter Validation
uses: ./.github/workflows/frontmatter-validation.yml
permissions:
contents: read
with:
soft-fail: false
changed-files-only: true
skip-footer-validation: false
warnings-as-errors: true
msdate-freshness:
name: ms.date Freshness Check
uses: ./.github/workflows/msdate-freshness-check.yml
permissions:
contents: read
with:
staleness-threshold-days: 90
changed-files-only: true
soft-fail: false
plugin-validation:
name: Plugin Validation
uses: ./.github/workflows/plugin-validation.yml
permissions:
contents: read
with:
soft-fail: false
skill-validation:
name: Skill Validation
uses: ./.github/workflows/skill-validation.yml
permissions:
contents: read
with:
soft-fail: false
changed-files-only: true
base-branch: ${{ github.event.pull_request.base.sha || format('origin/{0}', github.base_ref) }}
link-lang-check:
name: Link Language Check
uses: ./.github/workflows/link-lang-check.yml
permissions:
contents: read
with:
soft-fail: false
markdown-link-check:
name: Markdown Link Check
uses: ./.github/workflows/markdown-link-check.yml
permissions:
contents: read
with:
soft-fail: true
dependency-pinning-check:
name: Validate Dependency Pinning
uses: ./.github/workflows/dependency-pinning-scan.yml
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
with:
soft-fail: false
upload-sarif: true
upload-artifact: false
workflow-permissions-check:
name: Workflow Permissions Check
uses: ./.github/workflows/workflow-permissions-scan.yml
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
with:
soft-fail: false
upload-sarif: true
upload-artifact: false
action-version-consistency-scan:
name: Action Version Consistency Scan
uses: ./.github/workflows/action-version-consistency-scan.yml
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
with:
soft-fail: false
upload-sarif: true
upload-artifact: false
gitleaks-scan:
name: Gitleaks Secret Scan
uses: ./.github/workflows/gitleaks-scan.yml
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
with:
soft-fail: false
upload-sarif: true
upload-artifact: false
log-opts: '${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}'
npm-audit:
name: npm Security Audit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level=moderate
codeql:
name: CodeQL Security Analysis
uses: ./.github/workflows/codeql-analysis.yml
permissions:
contents: read
security-events: write # Required for SARIF upload to Security tab
actions: read