Skip to content

ci: improvements to speed and robustness #3228

ci: improvements to speed and robustness

ci: improvements to speed and robustness #3228

---
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:
contents: read
jobs:
linter:
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
pull-requests: write
security-events: write
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@0dcbedd66ea456ba2d54fd350affaa15df8a0da3 # v9.0.1
env:
APPLY_FIXES: all
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
if: success() || failure()
with:
sarif_file: megalinter-reports/megalinter-report.sarif
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: success() || failure()
with:
name: Linter Report
path: |
megalinter-reports
- uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1.19.0
with:
tool_name: MegaLinter