Skip to content

Fix permissions

Fix permissions #2060

Workflow file for this run

name: lint
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
pull_request:
branches:
- main
- dotnet-vnext
- dotnet-nightly
workflow_dispatch:
permissions:
contents: read
env:
FORCE_COLOR: 3
TERM: xterm
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
filter: 'tree:0'
show-progress: false
- name: Add actionlint problem matcher
run: echo "::add-matcher::.github/actionlint-matcher.json"
- name: Lint workflows
uses: docker://rhysd/actionlint:1.7.7
with:
args: -color
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@v19
with:
config: '.markdownlint.json'
globs: |
**/*.md
- name: Lint PowerShell in workflows
uses: martincostello/lint-actions-powershell@v1
with:
treat-warnings-as-errors: true
- name: Lint PowerShell scripts
shell: pwsh
run: |
$settings = @{
IncludeDefaultRules = $true
Severity = @("Error", "Warning")
}
$issues = Invoke-ScriptAnalyzer -Path ${env:GITHUB_WORKSPACE} -Recurse -ReportSummary -Settings $settings
foreach ($issue in $issues) {
$severity = $issue.Severity.ToString()
$level = $severity.Contains("Error") ? "error" : $severity.Contains("Warning") ? "warning" : "notice"
Write-Output "::${level} file=$($issue.ScriptName),line=$($issue.Line),title=PSScriptAnalyzer::$($issue.Message)"
}
if ($issues.Count -gt 0) {
exit 1
}