-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.22 KB
/
script-lint.yml
File metadata and controls
49 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Lint Install Scripts
on:
push:
branches: [ main ]
paths:
- 'install.sh'
- 'install.ps1'
pull_request:
branches: [ main ]
paths:
- 'install.sh'
- 'install.ps1'
permissions:
contents: read
jobs:
shellcheck:
name: Lint install.sh
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: '.'
additional_files: 'install.sh'
psscriptanalyzer:
name: Lint install.ps1
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
# Exclude PSAvoidUsingWriteHost - Write-Host is intentional for colored installer output
$results = Invoke-ScriptAnalyzer -Path ./install.ps1 -Severity Error,Warning -ExcludeRule PSAvoidUsingWriteHost,PSUseBOMForUnicodeEncodedFile
if ($results) {
$results | Format-Table -AutoSize
exit 1
}
Write-Host "✅ No issues found in install.ps1"