Coder Social home page Coder Social logo

Comments (11)

officel avatar officel commented on May 30, 2024 1

I am maybe encountering this same type of event.

my wf is

    steps:
      - uses: actions/checkout@master

      - name: Lint Ansible Playbook
        uses: ansible/[email protected]
        with:
          args: "-c ansible/.ansible-lint"

result is

image

from ansible-lint-action.

officel avatar officel commented on May 30, 2024 1

Unfortunately no.
Because only strings are allowed as input (args) for actions.
Arrays are not allowed.

from ansible-lint-action.

ssbarnea avatar ssbarnea commented on May 30, 2024

Can you please check if you get the same issue when calling ansible-lint 6.0.2 from the command line? I tried and apparently from command line it does recognize the command separated list correctly, without the extra space.

from ansible-lint-action.

nleiva avatar nleiva commented on May 30, 2024

Yeah, from the CLI I don't experience any issues.

from ansible-lint-action.

tigattack avatar tigattack commented on May 30, 2024

Same issue here 👍

from ansible-lint-action.

markdorison avatar markdorison commented on May 30, 2024

I am experiencing the same issue:

      - name: Run ansible-lint
        uses: ansible/ansible-lint-action@v6
        with:
          args: "-c ansible/.config/ansible-lint.yml ansible/"

CleanShot 2022-03-29 at 17 35 35@2x

from ansible-lint-action.

ssbarnea avatar ssbarnea commented on May 30, 2024

A PR would be really welcomed here!

from ansible-lint-action.

markdorison avatar markdorison commented on May 30, 2024

Updated ansible-lint-action version after upstream changes. ChromaticHQ/devops#1620

I would love to create one. I was searching the source to see where args might be manipulated but I am not seeing much. Does anyone have any insight as to where this might be occurring?

from ansible-lint-action.

ssbarnea avatar ssbarnea commented on May 30, 2024

I bet that if you use code below it will work:

with:
  args:
    - -c
    - ansible/.config/ansible-lint.yml
    - ansible/

Still, even if that works, the bug is still valid as we should split the args using shlex when it is a string instead of a list or arguments.

from ansible-lint-action.

ssbarnea avatar ssbarnea commented on May 30, 2024

I did a bit of research and it seems that current implementation of GHA does not allow us to pass arbitrary number of arguments to an action.

As I do not want to go to the slope of having to maintain a plethora of options for this action, I think I will replace args with path and mention that you can only pass one value.

Users will have to make use of ansible-lint config file for any arguments or fork the action and modify its action.yml file.

In fact even the path argument could be avoided because you could still edit the linter config to make it look only at certain paths, and avoid the need to pass it any arguments.

Sounds ok as a workaround? I am open to suggestions.

from ansible-lint-action.

officel avatar officel commented on May 30, 2024

Isn't renaming necessary?
Forcing other users to make changes is not a good idea.

I haven't found where it bugs me yet, but I did find a workaround for the -c option.
Also, on another matter, the --project-dir option doesn't seem to work.
It seems to work around that too.

    steps:
      - uses: actions/checkout@master

      - name: copy .ansible-lint
        shell: bash
        run: |
          cp ansible/.ansible-lint .

      - name: Lint Ansible Playbook
        uses: ansible/ansible-lint-action@v6
        with:
          args: ansible

it's my usecase,
I have an ansible directory in my repository.
The reason is that there are other directories, such as the terraform directory.

I am in the ansible directory when I work with ansible.
So .ansible-lint is also in the ansible directory

The error with -c option can be avoided by copying the .ansible-lint in my workflow.

By passing the working directory at the end of the args (path you changed) option,
I was able to make it almost the same as running locally.

I would like to see the changes to path revert for those who want to use the other options that are normal in ansible-lint.

Thanks for reading my bad English. 😄

from ansible-lint-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.