feat(queries): implementation of regal for linting rego files #841
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@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 |