ansible / ansible-lint

ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you
https://ansible.readthedocs.io/projects/lint/
GNU General Public License v3.0
3.4k stars 647 forks source link

github action: the role ansible-lint is supposed to test was not found #4245

Open JensTimmerman opened 1 week ago

JensTimmerman commented 1 week ago
Summary

I have repository containing an ansible role. When I enable ansible-lint github action, using the documented ansible-lint file, this results in an error: the role was not found.

Issue Type
OS / ENVIRONMENT
ansible-lint version: 6.17.2

This is run on github ci, using github workflows

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:
      - uses: actions/checkout@v4
      - name: Run ansible-lint
        uses: ansible/ansible-lint@v6
STEPS TO REPRODUCE

create a github action, following the documentation here: https://ansible.readthedocs.io/projects/lint/installing/#installing-from-source-code

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:
      - uses: actions/checkout@v4
      - name: Run ansible-lint
        uses: ansible/ansible-lint@v6
Desired Behavior

The ansible lint action as document should just work.

Actual Behavior
WARNING  Listing 1 violation(s) that are fatal
syntax-check[specific]: the role 'ansible-role-vaultwarden' was not found in /home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests/roles:/home/runner/.cache/ansible-compat/d4577d/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests
tests/test.yml:8:7
Error: the role 'ansible-role-vaultwarden' was not found in /home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests/roles:/home/runner/.cache/ansible-compat/d4577d/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests

                  Rule Violation Summary                   
 count tag                    profile rule associated tags 
     1 syntax-check[specific] min     core, unskippable    

Failed: 1 failure(s), 0 warning(s) o
JensTimmerman commented 1 week ago

I thought this could be fixed by changing the @v6 to @main, but that doens't seem to fix it

example of the failing pull request: https://github.com/JensTimmerman/ansible-role-vaultwarden/pull/32


  ansible-lint 
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.9/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.9/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.9/x64/lib
WARNING  Listing 4 violation(s) that are fatal
yaml[trailing-spaces]: Trailing spaces
.github/workflows/molecule.yml:1

yaml[indentation]: Wrong indentation: expected at least 3
molecule/default/verify.yml:8

name[casing]: All names should start with an uppercase letter.
tasks/version.yml:38 Task/Handler: print latest vaultwarden webvault release

syntax-check[specific]: the role 'ansible-role-vaultwarden' was not found in /home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests/roles:/home/runner/.cache/ansible-compat/d4577d/roles:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-vaultwarden/ansible-role-vaultwarden/tests