-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (70 loc) · 3.33 KB
/
Copy pathcode-quality.yml
File metadata and controls
75 lines (70 loc) · 3.33 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
name: Code Quality
# Fast, server-less repo-quality checks kept OUT of continuous-integration.yml, so that editing
# the public Doc/ or Samples/ material never triggers the heavy Windows build + serial
# live-server Pester acceptance suite (which needs secrets, cannot run in parallel and takes ~40m).
#
# CodeQL static analysis lives in its own codeql.yml. Dependabot is NOT a workflow - it is
# configured in .github/dependabot.yml and runs natively on GitHub's schedule.
on:
push:
branches: [ master ]
paths:
- 'Doc/**'
- 'Source/ISHRemote/Trisoft.ISHRemote/Samples/**'
- 'Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAnonymization.Tests.ps1'
- 'Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAiInstructions.Tests.ps1'
- '.github/instructions/**'
- '.github/copilot-instructions.md'
- '.claude/**'
- 'AGENTS.md'
- 'CLAUDE.md'
- '.github/workflows/code-quality.yml'
pull_request:
branches: [ master ]
paths:
- 'Doc/**'
- 'Source/ISHRemote/Trisoft.ISHRemote/Samples/**'
- 'Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAnonymization.Tests.ps1'
- 'Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAiInstructions.Tests.ps1'
- '.github/instructions/**'
- '.github/copilot-instructions.md'
- '.claude/**'
- 'AGENTS.md'
- 'CLAUDE.md'
- '.github/workflows/code-quality.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
anonymization:
name: Anonymization of public Doc and Samples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Pester Test Anonymization (no live server needed)
shell: pwsh
run: |
if (-not (Get-Module -ListAvailable -Name Pester | Where-Object { $_.Version -ge [version]'5.3.0' })) {
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Pester -MinimumVersion 5.3.0 -Force -SkipPublisherCheck -Scope CurrentUser
}
$result = Invoke-Pester -Path Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAnonymization.Tests.ps1 -Output Detailed -PassThru
if ($result.FailedCount -gt 0) {
throw "Anonymization guard failed: $($result.FailedCount) check(s) found a real URL, internal hostname, private IP or token. Use example.com placeholders or extend the known-exceptions list in the test."
}
ai-instructions:
name: AI instruction file consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Pester Test AI Instructions (no live server needed)
shell: pwsh
run: |
if (-not (Get-Module -ListAvailable -Name Pester | Where-Object { $_.Version -ge [version]'5.3.0' })) {
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Pester -MinimumVersion 5.3.0 -Force -SkipPublisherCheck -Scope CurrentUser
}
$result = Invoke-Pester -Path Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAiInstructions.Tests.ps1 -Output Detailed -PassThru
if ($result.FailedCount -gt 0) {
throw "AI instruction guard failed: $($result.FailedCount) check(s) found a structural inconsistency. See AGENTS.md > Maintaining these instructions."
}