-
Notifications
You must be signed in to change notification settings - Fork 315
47 lines (45 loc) · 1.94 KB
/
validate-cfn-samples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: validate-cfn-samples
on:
workflow_dispatch:
pull_request:
paths:
- "assets/queries/cloudFormation/**/test/*.yaml"
- "assets/queries/cloudFormation/**/test/*.json"
jobs:
validate-cfn-syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Get commit changed files
if: github.event_name != 'workflow_dispatch'
uses: lots0logs/gh-action-get-changed-files@6cb5164a823dbf3318b7c8032a333b4b7ed425b2 # 2.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get cfn-python-lint
run: |
pip3 install -U cfn-lint --user
- name: Validate ALL cloudformation template samples
if: github.event_name == 'workflow_dispatch'
run: |
python3 -u .github/scripts/samples-linters/validate-syntax.py \
"assets/queries/cloudFormation/**/test/*.yaml" \
"assets/queries/cloudFormation/**/test/*.json" \
--linter /home/runner/.local/bin/cfn-lint \
--extra " --info --config-file .github/scripts/samples-linters/.cfnlintrc.yml" \
--skip ".github/scripts/samples-linters/ignore-list/cloudformation" \
--verbose
- name: Validate CHANGED cloudformation template samples
if: github.event_name != 'workflow_dispatch'
run: |
python3 -u .github/scripts/samples-linters/validate-syntax.py \
"assets/queries/cloudFormation/**/test/*.yaml" \
"assets/queries/cloudFormation/**/test/*.json" \
--diff ${HOME}/files.json \
--linter /home/runner/.local/bin/cfn-lint \
--extra " --info --config-file .github/scripts/samples-linters/.cfnlintrc.yml" \
--skip ".github/scripts/samples-linters/ignore-list/cloudformation" -vv