-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (55 loc) · 2.05 KB
/
linting-formatting.yml
File metadata and controls
59 lines (55 loc) · 2.05 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
---
name: Linting & Formatting
on:
merge_group:
pull_request:
types: [opened, synchronize, reopened]
push:
# Run on push to main, this is not actionable
# but it gives us a baseline for PRs
branches: [main]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions: {}
jobs:
linter:
name: 🧹 Lint & Format
runs-on: ubuntu-latest
permissions:
contents: read
actions: read # is needed by zizmorcore/zizmor-action
pull-requests: write # is needed by oxsecurity/megalinter and reviewdog/action-suggester to post PR comments
security-events: write # is needed by oxsecurity/megalinter for uploading sarif files
steps:
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
disable-sudo: true
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
with:
persona: pedantic
# flavors/dotnet is the smallest flavor of MegaLinter that contains the linters
# we are interested in.
- uses: oxsecurity/megalinter/flavors/dotnet@62c799d895af9bcbca5eacfebca29d527f125a57 # v9.1.0
env:
APPLY_FIXES: all
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
if: success() || failure()
with:
sarif_file: megalinter-reports/megalinter-report.sarif
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: success() || failure()
with:
name: Linter Report
path: |
megalinter-reports
- uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1.24.0
with:
tool_name: MegaLinter