Skip to content

Commit

Permalink
Add actionlint
Browse files Browse the repository at this point in the history
- Add GitHub Actions workflow to lint workflows with actionlint.
- Add Visual Studio Code extensions configuration.
  • Loading branch information
martincostello authored Sep 5, 2023
1 parent b2dc8b3 commit 7c26c81
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ indent_size = 2
csharp_style_namespace_declarations = file_scoped:warning
indent_size = 4

[*.{csproj,json,props,ruleset,targets}]
indent_size = 2

[*.lock]
end_of_line = lf

Expand Down
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: lint

on:
push:
branches: [ main ]
paths-ignore:
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
pull_request:
branches:
- main
- dotnet-vnext
workflow_dispatch:

permissions:
contents: read

env:
FORCE_COLOR: 3
TERM: xterm

jobs:
lint:
runs-on: ubuntu-latest

steps:

- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Lint workflows
shell: bash
env:
ACTIONLINT_VERSION: '7b75d16d41920ec126e6f3269db0c6f3ab613c38' # v1.6.25
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl --silent --show-error "https://raw.githubusercontent.com/rhysd/actionlint/${ACTIONLINT_VERSION}/scripts/download-actionlint.bash")
./actionlint -color
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"ms-dotnettools.csharp",
"ms-vscode.PowerShell"
]
}

0 comments on commit 7c26c81

Please sign in to comment.