Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yamllint: command not found #37

Open
till opened this issue Jan 28, 2023 · 7 comments
Open

yamllint: command not found #37

till opened this issue Jan 28, 2023 · 7 comments

Comments

@till
Copy link

till commented Jan 28, 2023

Running your action with act currently produces:

[ci/helm-lint]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5-composite-yamllint.sh] user= workdir=
| ======================
| = Linting YAML files =
| ======================
| /var/run/act/actions/[email protected]/entrypoint.sh: line 34: yamllint: command not found

This is how I use it:

---
name: ci

on:
  pull_request

jobs:
  helm-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ibiqlik/[email protected]
        with:
          format: github
          file_or_dir: |
            certmanager
            certmanager-config
            cloudnative-pg
            haproxy-ingress
            postgresql
@sakulali
Copy link

sakulali commented Feb 12, 2023

I found the same problem when use act for local ci test.
7c2984fa-f698-49d1-a2b6-71dbaa68d2fc
Part of my workflows job show:

yamllint-checker:
    needs: changes
    if: |
      (needs.changes.outputs.yaml == 'true')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Yamllint checker
        uses: ibiqlik/action-yamllint@v3
        with:
          file_or_dir: samples/deploy 
          config_file: .yamllint.yml 

@till
Copy link
Author

till commented Feb 12, 2023

I just looked at the action, it seems it doesn't actually install yamllint? I am a bit confused.

@ReenigneArcher
Copy link

ReenigneArcher commented May 11, 2023

I'm facing the same issue in a self hosted runner. I was under the impression this was a docker action (https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action), but it appears to be a composite action which only runs the entrypoint.sh...

Looks like versions prior to v3 might work. https://github.com/ibiqlik/action-yamllint/releases/tag/v3.0.0

Perhaps the action should verify that yamllint is installed? And if not, install it into a venv that is then destroyed.

I will take a stab at this improvement. If it wouldn't be accepted, please let me know though so I don't waste my time.

@atkinsonm
Copy link

I was able to fork this repository and fix it for myself by modifying action.yml to replace

using: 'composite'
steps:
    - run: ${{ github.action_path }}/entrypoint.sh
      shell: bash
      env:
        INPUT_FILE_OR_DIR: ${{ inputs.file_or_dir }}
        INPUT_CONFIG_FILE: ${{ inputs.config_file }}
        INPUT_CONFIG_DATA: ${{ inputs.config_data }}
        INPUT_FORMAT: ${{ inputs.format }}
        INPUT_STRICT: ${{ inputs.strict }}

with

using: 'docker'
image: 'Dockerfile'

If this has no other unwanted side effects, I would like to see this fixed upstream.

@till
Copy link
Author

till commented Jul 19, 2023

Good thinking! The only problem I can see is that this builds the image each time.

@ReenigneArcher
Copy link

I ended up installing into a venv, and destroying the venv afterwards. It's not necessary to destroy after on a GitHub runner, but it could be necessary in a self hosted runner. I'd be happy to submit a PR... if this would be desirable, please let me know.

@atkinsonm
Copy link

From what I'm reading, pip installing into a temporary venv as part of the composite action steps seems like the best path forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants