Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Provide an example with multiple path #10

Closed
tristanbes opened this issue Jan 20, 2020 · 3 comments · Fixed by #11
Closed

Provide an example with multiple path #10

tristanbes opened this issue Jan 20, 2020 · 3 comments · Fixed by #11

Comments

@tristanbes
Copy link
Contributor

tristanbes commented Jan 20, 2020

Hello,

The doc misses an example with multiple playbook linting;

Right now I've tried:

name: CI  # feel free to pick your own name

on: pull_request

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    # Important: This sets up your GITHUB_WORKSPACE environment variable
    - uses: actions/checkout@v2

    - name: Install dependencies
      run: ansible-galaxy install -r roles/requirements.yml --force

    - name: Lint Ansible Playbook
      # replace "master" with any valid ref
      uses: ansible/ansible-lint-action@master
      with:
        # [required]
        # Paths to ansible files (i.e., playbooks, tasks, handlers etc..)
        # or valid Ansible directories according to the Ansible role
        # directory structure.
        targets:
          - "playbook-example.yml"
          - "playbook-provisionning.yml"

But Github says that

### ERRORED 13:29:06Z

- Your workflow file was invalid: The pipeline is not valid. .github/workflows/ci.yml (Line: 26, Col: 11): A sequence was not expected
@tristanbes
Copy link
Contributor Author

tristanbes commented Jan 20, 2020

Correct syntax is:

targets: |
  playbook-example.yml
  playbook-provisionning.yml

@webknjaz
Copy link
Member

But Github says that

### ERRORED 13:29:06Z

- Your workflow file was invalid: The pipeline is not valid. .github/workflows/ci.yml (Line: 26, Col: 11): A sequence was not expected

Yea... So GitHub uses environment variables to bypass inputs (the thing that you declare under with) using env vars which only support string values. The action will get INPUT_TARGETS internally with a string. So that's why GH prevents you from doing that.

@webknjaz
Copy link
Member

@tristanbes thanks for the clarification, PRs are welcome :)

@tristanbes tristanbes mentioned this issue Jan 20, 2020
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants