Skip to content

Commit

Permalink
ci: Add ShellCheck workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Apr 11, 2023
1 parent b3dd39d commit e7c6f06
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/problem-matcher-gcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "shellcheck-gcc",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(note|warning|error):\\s(.*)\\s\\[(SC\\d+)\\]$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
22 changes: 22 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ShellCheck

on:
push:
workflow_dispatch:

permissions:
contents: read

jobs:
shellcheck:
name: Lint with shellcheck
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/[email protected]

- name: Add error matcher
run: echo "::add-matcher::$(pwd)/.github/problem-matcher-gcc.json"

- name: Run shellcheck
run: shellcheck -o all -s sh -f gcc $(find . -path ./.git -prune -o -type f -executable -print)

0 comments on commit e7c6f06

Please sign in to comment.