Skip to content

Commit 1c0e0e6

Browse files
committed
Make cfn-lint conditional
1 parent fc74f01 commit 1c0e0e6

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/quality-checks.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
make install
5656
5757
- name: Generate and check SBOMs
58-
uses: NHSDigital/eps-action-sbom@npm20_version
58+
uses: NHSDigital/eps-action-sbom@main
5959
with:
6060
node_version: ${{ inputs.node_version }}
6161

@@ -68,9 +68,28 @@ jobs:
6868
- name: Check licenses
6969
run: make check-licenses
7070

71-
- name: Run linting
71+
- name: Run linting for TypeScript and Python
7272
run: make lint
7373

74+
- name: Check for CloudFormation templates
75+
id: check_cfn_templates
76+
run: |
77+
if [ -d "cloudformation" ] || [ -d "SAMtemplates" ]; then
78+
echo "exists=true" >> $GITHUB_OUTPUT
79+
else
80+
echo "exists=false" >> $GITHUB_OUTPUT
81+
fi
82+
83+
- name: Install cfn-lint
84+
if: steps.check_cfn_templates.outputs.exists == 'true'
85+
run: pip install cfn-lint
86+
87+
- name: Run cfn-lint
88+
if: steps.check_cfn_templates.outputs.exists == 'true'
89+
run: |
90+
cfn-lint -I "cloudformation/**/*.y*ml" 2>&1 | awk '/Run scan/ { print } /^[EW][0-9]/ { print; getline; print }'
91+
cfn-lint -I "SAMtemplates/**/*.y*ml" 2>&1 | awk '/Run scan/ { print } /^[EW][0-9]/ { print; getline; print }'
92+
7493
- name: Run unit tests
7594
run: make test
7695

0 commit comments

Comments
 (0)