Skip to content

Commit b25131d

Browse files
authored
fix(flex-edge): shellcheck complaints (#437)
1 parent 8f89c23 commit b25131d

File tree

3 files changed

+255
-214
lines changed

3 files changed

+255
-214
lines changed

.github/workflows/shellcheck.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
# the paths in sync and the exclusion logic.
99
paths:
1010
# Include all shell scripts except those in docker/openemr/obsolete/
11-
- '{!docker/openemr/obsolete/,}**.sh'
11+
- '**.sh'
12+
- '**.source'
1213
- '.github/workflows/shellcheck.yml'
1314
- 'docker/openemr/flex-*/utilities/devtools'
1415
- 'kubernetes/kub-down'
@@ -19,12 +20,16 @@ on:
1920
- 'utilities/openemr-env-installer/openemr-env-installer'
2021
- 'utilities/openemr-env-migrator/openemr-env-migrator'
2122
- 'utilities/openemr-monitor/monitor-installer'
23+
# Exclude everything in obsolete.
24+
# This needs to be last.
25+
- '!docker/openemr/obsolete/**'
2226
pull_request:
2327
branches:
2428
- master
2529
paths:
2630
# Include all shell scripts except those in docker/openemr/obsolete/
27-
- '{!docker/openemr/obsolete/,}**.sh'
31+
- '**.sh'
32+
- '**.source'
2833
- '.github/workflows/shellcheck.yml'
2934
- 'docker/openemr/flex-*/utilities/devtools'
3035
- 'kubernetes/kub-down'
@@ -35,6 +40,9 @@ on:
3540
- 'utilities/openemr-env-installer/openemr-env-installer'
3641
- 'utilities/openemr-env-migrator/openemr-env-migrator'
3742
- 'utilities/openemr-monitor/monitor-installer'
43+
# Exclude everything in obsolete.
44+
# This needs to be last.
45+
- '!docker/openemr/obsolete/**'
3846
jobs:
3947
shellcheck:
4048
name: ShellCheck
@@ -59,8 +67,8 @@ jobs:
5967
# See https://github.com/tj-actions/changed-files/blob/v46/README.md#inputs-%EF%B8%8F
6068
# for tj-actions/changed-files specific syntax
6169
files: |
62-
!docker/openemr/obsolete/**
6370
**.sh
71+
**.source
6472
docker/openemr/flex-*/utilities/devtools
6573
kubernetes/kub-down
6674
kubernetes/kub-up
@@ -70,6 +78,7 @@ jobs:
7078
utilities/openemr-env-installer/openemr-env-installer
7179
utilities/openemr-env-migrator/openemr-env-migrator
7280
utilities/openemr-monitor/monitor-installer
81+
!docker/openemr/obsolete/**
7382
- name: Create unique files list
7483
id: unique-files
7584
run: |
@@ -92,9 +101,11 @@ jobs:
92101
# Use the same paths as in the on.push and on.pull_request sections
93102
# to ensure we only check shell files.
94103
# Use globstar to find shell files in subdirectories.
95-
shopt -s globstar
96-
files_to_check=(
104+
# We can't easily exclude obsolete here, so we exclude it later...
105+
shopt -s globstar nullglob
106+
files_to_check+=(
97107
**/*.sh
108+
**/*.source
98109
docker/openemr/flex-*/utilities/devtools
99110
kubernetes/kub-down
100111
kubernetes/kub-up
@@ -126,6 +137,11 @@ jobs:
126137
echo "files=${unique_files[*]}" >> "$GITHUB_OUTPUT"
127138
- name: Run shellcheck on unique files
128139
if: ${{ steps.unique-files.outputs.files != '' }}
140+
# Pipefail is somehow only enabled when we explicitly
141+
# specify the shell as bash, even though bash is the
142+
# default shell. I would complain further, but
143+
# this kind of inconsistency is very shell-like anyway.
144+
shell: bash
129145
run: |
130146
shellcheck --check-sourced --external-sources --format=checkstyle ${{ steps.unique-files.outputs.files }} | tee checkstyle-shellcheck.xml
131147
- uses: staabm/annotate-pull-request-from-checkstyle-action@v1

0 commit comments

Comments
 (0)