File tree Expand file tree Collapse file tree 4 files changed +77
-1
lines changed Expand file tree Collapse file tree 4 files changed +77
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ prominently in the GitHub user interface.
10
10
This directory contains Problem Matchers used by the GitHub Actions workflows
11
11
in the [ ` workflows ` ] ( ./workflows ) subdirectory.
12
12
13
+ ## Original sources
14
+
13
15
The following problem matcher JSON files found in this directory were copied
14
16
from the [ Home Assistant] ( https://github.com/home-assistant/core ) project on
15
17
GitHub. The Home Assistant project is licensed under the Apache 2.0 open-source
@@ -28,4 +30,10 @@ The following problem matcher JSON file came from the
28
30
[ hadolint-action] ( https://github.com/hadolint/hadolint-action ) repository
29
31
(copied on 2025-02-17, version 3.1.0):
30
32
31
- - [ ` problem-matcher.json ` ] ( https://github.com/hadolint/hadolint-action/blob/master/problem-matcher.json )
33
+ - [ ` hadolint.json ` ] ( https://github.com/hadolint/hadolint-action/blob/master/problem-matcher.json )
34
+
35
+ The Shellcheck problem matcher JSON file came from the
36
+ [ shellcheck-problem-matchers] ( uhttps://github.com/lumaxis/shellcheck-problem-matchers )
37
+ repository (copied 2025-02-26, version v2.1.0).
38
+
39
+ - [ ` shellcheck-tty.json ` ] ( https://github.com/lumaxis/shellcheck-problem-matchers/blob/main/.github/shellcheck-tty.json )
Original file line number Diff line number Diff line change
1
+ {
2
+ "problemMatcher" : [
3
+ {
4
+ "owner" : " shellcheck" ,
5
+ "pattern" : [
6
+ {
7
+ "regexp" : " ^In\\ s(.+)\\ sline\\ s(\\ d+):$" ,
8
+ "file" : 1 ,
9
+ "line" : 2
10
+ },
11
+ {
12
+ "regexp" : " .*"
13
+ },
14
+ {
15
+ "regexp" : " SC(\\ d+)(\\ s\\ ((note|warning|error)\\ ))?:\\ s(.+)$" ,
16
+ "code" : 1 ,
17
+ "severity" : 3 ,
18
+ "message" : 4 ,
19
+ "loop" : true
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
Original file line number Diff line number Diff line change 91
91
json_files : ${{steps.filter.outputs.json_files}}
92
92
docker : ${{steps.filter.outputs.docker}}
93
93
docker_files : ${{steps.filter.outputs.docker_files}}
94
+ shell : ${{steps.filter.outputs.shell}}
95
+ shell_files : ${{steps.filter.outputs.shell_files}}
94
96
steps :
95
97
# When invoked manually, use the given SHA to figure out the change list.
96
98
- if : github.event_name == 'workflow_dispatch'
@@ -146,6 +148,9 @@ jobs:
146
148
docker:
147
149
- '**/dockerfile'
148
150
- '**/Dockerfile'
151
+ shell:
152
+ - '**/*.sh'
153
+ - 'check/*'
149
154
150
155
setup :
151
156
if : needs.changes.outputs.python == 'true'
@@ -518,3 +523,23 @@ jobs:
518
523
- name : Verify that all GitHub Actions workflows are valid
519
524
run : |
520
525
/opt/homebrew/bin/actionlint -color
526
+
527
+ shell-script-lint :
528
+ if : needs.changes.outputs.shell == 'true'
529
+ name : Shell script checks
530
+ needs : changes
531
+ runs-on : ubuntu-24.04
532
+ timeout-minutes : 5
533
+ env :
534
+ changed_files : ${{needs.changes.outputs.shell_files}}
535
+ steps :
536
+ - name : Check out a copy of the git repository
537
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
538
+
539
+ - name : Set up shellcheck output problem matcher
540
+ run : |
541
+ echo "::add-matcher::.github/problem-matchers/shellcheck.json"
542
+
543
+ - name : Run shellcheck on shell scripts that have been changed
544
+ run : |
545
+ shellcheck ${{env.changed_files}}
Original file line number Diff line number Diff line change
1
+ # Summary: config file for shellcheck program.
2
+ #
3
+ # The following page includes information about the .shellcheckrc file:
4
+ # https://github.com/koalaman/shellcheck/wiki/Directive#shellcheckrc-file
5
+ #
6
+ # Optional settings can be discovered by running "shellcheck --list-optional".
7
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
+
9
+ # We use bash for all the scripts, so tell shellcheck to assume this dialect.
10
+ shell =bash
11
+
12
+ # Makes shellcheck include files pointed-to by the source or . statements.
13
+ external-sources =true
14
+
15
+ # Enable check for when a script uses "set -e" but a construct may disable it.
16
+ enable =check-set-e-suppressed
17
+
18
+ # Enable check for tests like [ "$var" ], which are best written [ -n "$var" ].
19
+ enable =avoid-nullary-conditions
You can’t perform that action at this time.
0 commit comments