-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.18 KB
/
Copy pathpowershell.yml
File metadata and controls
43 lines (40 loc) · 1.18 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
name: Script validation
on:
push:
pull_request:
permissions:
contents: read
jobs:
validate:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Install PSScriptAnalyzer
shell: pwsh
run: Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
- name: Parse script
shell: pwsh
run: |
$tokens = $errors = $null
[void] [System.Management.Automation.Language.Parser]::ParseFile(
(Resolve-Path .\muscriptor_manager.ps1), [ref] $tokens, [ref] $errors)
if ($errors.Count -gt 0) {
$errors | ForEach-Object Message | Write-Error
exit 1
}
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
$issues = Invoke-ScriptAnalyzer -Path .\muscriptor_manager.ps1 -Severity Error
if ($issues) {
$issues | Format-Table -AutoSize | Out-String | Write-Error
exit 1
}
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check Bash syntax
run: bash -n muscriptor_manager.sh
- name: Run ShellCheck
run: shellcheck muscriptor_manager.sh