From d691a627a39dcdf3021c056e61742476cead90ee Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Thu, 24 Aug 2023 09:25:18 -0500 Subject: [PATCH 1/3] Add an ansible-lint action. --- .github/workflows/ansible-lint.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ansible-lint.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml new file mode 100644 index 00000000..6e4add05 --- /dev/null +++ b/.github/workflows/ansible-lint.yml @@ -0,0 +1,20 @@ +name: ansible-lint +on: [push, pull_request] + +jobs: + build: + name: Ansible Lint # Naming the build is important to use it as a status check + runs-on: ubuntu-latest + + steps: + # Important: This sets up your GITHUB_WORKSPACE environment variable + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # needed for progressive mode to work + + - name: Run ansible-lint + # replace `main` with any valid ref, or tags like `v6` + uses: ansible/ansible-lint-action@main + # optional: + # with: + path: "ansible" # <-- only one value is allowed From 50a9c80ba2bf779e61e8b173386caaf24e5e69db Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Thu, 24 Aug 2023 09:48:14 -0500 Subject: [PATCH 2/3] squash: Use ansible-lint-action from the marketplace. --- .github/workflows/ansible-lint.yml | 61 +++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 6e4add05..3b7c2d0c 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -1,20 +1,55 @@ -name: ansible-lint +name: Run ansible-lint + on: [push, pull_request] jobs: - build: - name: Ansible Lint # Naming the build is important to use it as a status check + check-ansible-syntax: + runs-on: ubuntu-latest steps: - # Important: This sets up your GITHUB_WORKSPACE environment variable - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # needed for progressive mode to work + # Important: This sets up your GITHUB_WORKSPACE environment variable + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + # replace "main" with any valid ref + uses: osism/ansible-lint-action@main + with: + # [required] + # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) + # or valid Ansible directories according to the Ansible role + # directory structure. + # If you want to lint multiple ansible files, use the following syntax + # targets: | + # playbook_1.yml + # playbook_2.yml + targets: "ansible" + # [optional] + # Arguments to override a package and its version to be set explicitly. + # Must follow the example syntax. + override-deps: | + ansible==5.2.0 + ansible-lint==5.3.2 + # [optional] + # Arguments to be passed to the ansible-lint - - name: Run ansible-lint - # replace `main` with any valid ref, or tags like `v6` - uses: ansible/ansible-lint-action@main - # optional: - # with: - path: "ansible" # <-- only one value is allowed + # Options: + # -q quieter, although not silent output + # -p parseable output in the format of pep8 + # --parseable-severity parseable output including severity of rule + # -r RULESDIR specify one or more rules directories using one or + # more -r arguments. Any -r flags override the default + # rules in ansiblelint/rules, unless -R is also used. + # -R Use default rules in ansiblelint/rules in addition to + # any extra + # rules directories specified with -r. There is no need + # to specify this if no -r flags are used + # -t TAGS only check rules whose id/tags match these values + # -x SKIP_LIST only check rules whose id/tags do not match these + # values + # --nocolor disable colored output + # --exclude=EXCLUDE_PATHS + # path to directories or files to skip. This option is + # repeatable. + # -c C Specify configuration file to use. Defaults to ".ansible-lint" + args: "" From 20317a636a383d972ca0718aafca382740470128 Mon Sep 17 00:00:00 2001 From: Aaron van Meerten Date: Mon, 25 Sep 2023 08:56:06 -0500 Subject: [PATCH 3/3] Update ansible-lint.yml --- .github/workflows/ansible-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 3b7c2d0c..85c37547 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -28,8 +28,8 @@ jobs: # Arguments to override a package and its version to be set explicitly. # Must follow the example syntax. override-deps: | - ansible==5.2.0 - ansible-lint==5.3.2 + ansible==6.7.0 + ansible-lint==6.10.2 # [optional] # Arguments to be passed to the ansible-lint