diff --git a/.github/lint/.yamllint.yaml b/.github/lint/.yamllint.yaml new file mode 100644 index 0000000..df1ff7a --- /dev/null +++ b/.github/lint/.yamllint.yaml @@ -0,0 +1,19 @@ +ignore: | + *.sops.* + gotk-components.yaml +extends: default +rules: + truthy: + allowed-values: ["true", "false", "on"] + comments: + min-spaces-from-content: 1 + line-length: disable + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + indentation: + spaces: 2 + indent-sequences: consistent diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..267b213 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,29 @@ +--- +name: Lint YAML files + +on: + pull_request: + paths: + - "**.yaml" + - "**.yml" + +jobs: + yamllint: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get changes + uses: dorny/paths-filter@v3 + id: filter + with: + list-files: shell + filters: | + yaml: + - added|modified: "**.yaml" + - added|modified: "**.yml" + - name: Lint files + if: ${{ steps.filter.outputs.yaml == 'true' }} + uses: reviewdog/action-yamllint@v1 + with: + yamllint_flags: "-c .github/lint/.yamllint.yaml ${{ steps.filter.outputs.yaml_files }}"