diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..9b8e1ff1 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,24 @@ +--- +name: Lint Policies + +on: + pull_request: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Lint cnspec policies and output SARIF + uses: mondoohq/actions/cnspec-lint@main + with: + path: . + output-file: 'results.sarif' + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif \ No newline at end of file diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml deleted file mode 100644 index f01591d8..00000000 --- a/.github/workflows/validate.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Validate Policies - -on: - pull_request: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Install Mondoo's cnspec - run: | - bash -c "$(curl -sSL https://install.mondoo.com/sh/cnspec)" - shell: bash - - name: Validate policies - shell: bash - run: > - find . -name '*.mql.yaml' -exec cnspec bundle validate {} \; \ No newline at end of file