Skip to content

ci(deps): bump actions/checkout from 6 to 7 in the github-actions group across 1 directory #33

ci(deps): bump actions/checkout from 6 to 7 in the github-actions group across 1 directory

ci(deps): bump actions/checkout from 6 to 7 in the github-actions group across 1 directory #33

name: PowerShell Check
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
syntax:
name: PowerShell syntax and quality check
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Check PowerShell script syntax
shell: pwsh
run: pwsh -NoProfile -File tools/test-powershell-syntax.ps1
- name: Check Markdown relative links
shell: pwsh
run: pwsh -NoProfile -File tools/test-markdown-links.ps1
- name: Install analyzer
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
$results = Invoke-ScriptAnalyzer -Path . -Recurse -Settings PSScriptAnalyzerSettings.psd1
$results | Format-Table -AutoSize
$errors = @($results | Where-Object { $_.Severity -eq 'Error' })
if ($errors.Count -gt 0) {
$errors | Format-Table -AutoSize
throw "PSScriptAnalyzer found error-level issues."
}
Write-Host "PSScriptAnalyzer completed: $($results.Count) finding(s), $($errors.Count) error(s)."
- name: Check toolkit documentation pairs
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$excluded = @('.git', '.github', 'docs')
$toolDirs = Get-ChildItem -Path . -Directory | Where-Object {
($excluded -notcontains $_.Name) -and
(Get-ChildItem -Path $_.FullName -Filter '*.ps1' -File -ErrorAction SilentlyContinue)
}
$failed = $false
foreach ($dir in $toolDirs) {
$english = Get-ChildItem -Path $dir.FullName -Filter 'README-*.md' -File | Where-Object { $_.Name -notmatch '-ru\.md$' }
$russian = Get-ChildItem -Path $dir.FullName -Filter 'README-*-ru.md' -File
if (-not $english -or -not $russian) {
$failed = $true
Write-Error "Toolkit '$($dir.Name)' should have both English and Russian README files."
}
}
if ($failed) {
throw 'Toolkit documentation pair check failed.'
}
Write-Host "PASS: checked $($toolDirs.Count) toolkit documentation pair(s)."