-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (71 loc) · 2.27 KB
/
lint.yml
File metadata and controls
90 lines (71 loc) · 2.27 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Lint and Validate
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
security-events: write
jobs:
pre-commit:
name: Run Pre-Commit Checks
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install pre-commit
run: pip install pre-commit
- name: Install uv for Mypy and Pyright
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync --group dev
- name: Set up Node.js for markdownlint
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install markdownlint-cli2
run: npm install -g markdownlint-cli2
- name: Run pre-commit hooks (except PSScriptAnalyzer)
run: |
# Skip PSScriptAnalyzer as it requires Windows
SKIP=psscriptanalyzer pre-commit run --all-files --show-diff-on-failure
powershell:
name: PowerShell Script Analysis
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@v1.1
with:
path: ./scripts/windows
recurse: true
output: results.sarif
ignorePattern: '\.git|\.github'
- name: Upload PSScriptAnalyzer results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: results.sarif
security:
name: Security Scan
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run Trivy security scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'