Skip to content

Lint PowerShell with PSScriptAnalyzer - [chore: move config to .config/ #19] by @o-l-a-v #7

Lint PowerShell with PSScriptAnalyzer - [chore: move config to .config/ #19] by @o-l-a-v

Lint PowerShell with PSScriptAnalyzer - [chore: move config to .config/ #19] by @o-l-a-v #7

name: Lint PowerShell with PSScriptAnalyzer
run-name: "${{ github.workflow }} - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
on:
pull_request:
paths:
- "**.ps1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-powershell:
name: Lint PowerShell with PSScriptAnalyzer
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: 🛎️ GitHub checkout branch "${{ github.head_ref || github.ref_name }}"
uses: actions/checkout@v6
with:
persist-credentials: false
- name: 🔍 Get changed files
id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
filters: |
ps1:
- added|modified: '**.ps1'
list-files: json
- name: 🔍 Lint with PSScriptAnalyzer
if: steps.filter.outputs.ps1 == 'true'
shell: pwsh
run: |
& tools/Lint-PowerShell.ps1 -FilePaths (
ConvertFrom-Json -InputObject '${{ steps.filter.outputs.ps1_files }}'
)