-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.52 KB
/
Copy pathlint.yml
File metadata and controls
42 lines (39 loc) · 1.52 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
name: Lint
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Курируемые скрипты репозитория — строгий порог (предупреждения).
- name: Run shellcheck (curated, warning level)
run: >
find . -name '*.sh'
-not -path './linux/1c/*'
-not -path './pgsql/pgpro/*'
-print0 | xargs -0 shellcheck -S warning
# Импортированные рабочие скрипты (1С, Postgres Pro/wal-g) приняты «как есть»
# с боевых серверов — порог ошибок, чтобы не переписывать проверенную логику.
- name: Run shellcheck (imported, error level)
run: >
find ./linux/1c ./pgsql/pgpro -name '*.sh'
-print0 | xargs -0 shellcheck -S error
psscriptanalyzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
$results = Get-ChildItem -Path . -Recurse -Filter *.ps1 |
ForEach-Object { Invoke-ScriptAnalyzer -Path $_.FullName -Severity Error }
if ($results) {
$results | Format-Table -AutoSize | Out-String | Write-Host
exit 1
}
Write-Host 'PSScriptAnalyzer: no errors found.'