Skip to content

F OpenNebula/one-infra#480: Add Packer build tools #50

F OpenNebula/one-infra#480: Add Packer build tools

F OpenNebula/one-infra#480: Add Packer build tools #50

Workflow file for this run

name: PowerShell Linting
on: [push, pull_request]
jobs:
# https://docs.github.com/en/actions/guides/building-and-testing-powershell#using-psscriptanalyzer-to-lint-code
lint-with-PSScriptAnalyzer:
name: Install and run PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path src/*.ps1 -Recurse -Outvariable issues
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}