Skip to content

Add lint configuration #99

Add lint configuration

Add lint configuration #99

Workflow file for this run

name: PSScriptAnalyzer
defaults:
run:
shell: pwsh
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '22 1 * * 3'
permissions:
contents: read
jobs:
build:
permissions:
contents: read
security-events: write
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Move module
run: |
if ($IsWindows) {
$path = "$HOME\Documents\PowerShell\Modules"
} else {
$path = "$HOME/.local/share/powershell/Modules"
}
Copy-Item src AnyPackageDsc
Copy-Item AnyPackageDsc $path
Get-Module AnyPackageDsc -ListAvailable
- name: Install AnyPackage
run: Install-PSResource AnyPackage -TrustRepository
- name: Install ConvertToSARIF
run: Install-PSResource ConvertToSARIF -TrustRepository
- name: Run PSScriptAnalyzer
run: |
Import-Module AnyPackage, ConvertToSARIF -PassThru
Invoke-ScriptAnalyzer -Path ./src -Recurse | ConvertTo-SARIF -FilePath results.sarif
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif