fix(tests): severity check tests #744
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
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@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 |