From 1d6267ea893b5b72dda65f8b1388b34310d0ffb1 Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 8 Feb 2021 21:26:47 +0100 Subject: [PATCH] add ansible and yaml linting check --- .ansible-lint | 7 +++++++ .github/workfows/ansible-linting-check.yml | 22 ++++++++++++++++++++++ .github/workfows/yamllint.yaml | 22 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .ansible-lint create mode 100644 .github/workfows/ansible-linting-check.yml create mode 100644 .github/workfows/yamllint.yaml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..3dd2321 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,7 @@ +use_default_rules: true + +#skip_list: +# - '106' # skip name formatting rule + +exclude_paths: + - roles/ diff --git a/.github/workfows/ansible-linting-check.yml b/.github/workfows/ansible-linting-check.yml new file mode 100644 index 0000000..41dcb97 --- /dev/null +++ b/.github/workfows/ansible-linting-check.yml @@ -0,0 +1,22 @@ +--- +name: Ansible Lint check + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: "." + # [required] + # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) + args: "" + # [optional] diff --git a/.github/workfows/yamllint.yaml b/.github/workfows/yamllint.yaml new file mode 100644 index 0000000..39c49f8 --- /dev/null +++ b/.github/workfows/yamllint.yaml @@ -0,0 +1,22 @@ +--- +name: 'Yamllint GitHub Actions' + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + yamllint: + name: 'Yamllint' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Yamllint' + uses: karancode/yamllint-github-action@master + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: './.yamllint' + yamllint_strict: false + yamllint_comment: true +# env: +# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }