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

How to add additional cfc-lint module? #274

Open
keironlowe-edriving opened this issue Mar 28, 2023 · 1 comment
Open

How to add additional cfc-lint module? #274

keironlowe-edriving opened this issue Mar 28, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@keironlowe-edriving
Copy link

keironlowe-edriving commented Mar 28, 2023

Hi, I'm trying to implement this with the additional Serverless Rules module but it doesn't work. It fails with the following error...

2023-03-28 14:49:11,320 - cfnlint - ERROR - Tried to append rules but got an error: No module named 'cfn_lint_serverless'

Not 100% familiar with Python, but could it be that you're setting up a virtual python env? So when I do pip install cfn-lint-serverless it's not being installed into the correct env? If so, could a possible solution be to add the path to the virtual env as an output for the step?

Below is my workflow file...

name: CI

on:
  pull_request:

jobs:
  cfn_lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup Cloud Formation Linter with Latest Version
        uses: scottbrenner/cfn-lint-action@v2

      - run: pip install cfn-lint-serverless

      - name: Print the Cloud Formation Linter Version & run Linter.
        run: |
          cfn-lint --version
          cfn-lint -t template.yaml -a cfn_lint_serverless.rules
@keironlowe-edriving
Copy link
Author

Worked around it by using the following steps, to find the virtual env python executable and install the module using that, but obviously not an ideal solution.

- name: Find Python Virtual Env
  run: echo "VIRTUAL_ENV=\"$(find /tmp/setup-cfn-lint-*/.venv/bin/python -name 'python' -maxdepth 1)\"" >> $GITHUB_ENV

- name: Install Serverless Rules
  run: ${{ env.VIRTUAL_ENV }} -m pip install cfn-lint-serverless

@ScottBrenner ScottBrenner added bug Something isn't working help wanted Extra attention is needed labels Apr 1, 2023
@ScottBrenner ScottBrenner self-assigned this Aug 19, 2024
@ScottBrenner ScottBrenner linked a pull request Aug 19, 2024 that will close this issue
@ScottBrenner ScottBrenner removed their assignment Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants