Skip to content

Commit

Permalink
Update pscriptanalyzer.yaml to use Node20 instead of deprecatated Node16
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnybottles committed Nov 19, 2024
1 parent 56d8b10 commit 6684d61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/psscriptanalzyer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@ jobs:
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
$settings = Join-Path $env:GITHUB_WORKSPACE '.github/psscriptanalyzer/PSScriptAnalyzerSettings.psd1'
# Verify settings file exists
$settingsPath = Join-Path $env:GITHUB_WORKSPACE '.github/psscriptanalyzer/PSScriptAnalyzerSettings.psd1'
if (-not (Test-Path $settingsPath)) {
Write-Error "PSScriptAnalyzer settings file not found at: $settingsPath"
Write-Host "Directory contents:"
Get-ChildItem -Path $env:GITHUB_WORKSPACE/.github -Recurse
exit 1
}
$results = @()
# Analyze all PowerShell files
Get-ChildItem -Path $env:GITHUB_WORKSPACE -Recurse -Include *.ps1,*.psm1,*.psd1 |
ForEach-Object {
$analysis = Invoke-ScriptAnalyzer -Path $_.FullName -Settings $settings
Write-Host "Analyzing $($_.FullName)"
$analysis = Invoke-ScriptAnalyzer -Path $_.FullName -Settings $settingsPath
if ($analysis) {
$results += $analysis
}
Expand Down
2 changes: 1 addition & 1 deletion Hawk/tests/general/Test-PreCommitHook.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 3. Observe the PSScriptAnalyzer warnings/errors

#region Good Code Examples - These will pass PSScriptAnalyzer
# add comment to test this
# add comment to test
function Test-GoodFunction {
[CmdletBinding()]
param (
Expand Down

0 comments on commit 6684d61

Please sign in to comment.