skip to Main Content

I am trying to exclude .md files from my super linter because it gets caught every time but can’t seem to figure it out can someone help?

jobs: 
  super-linter:
    name: Lint code and merge
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Super-Linter
        uses: github/[email protected]
        with:   
          exclusions: |
            markdown: true
          files: ${{ join(github.event.push_request.changed_files, ',') }}

  deploy: 
      runs-on: self-hosted   
      needs: [super-linter] 
      steps: 
        #- uses: actions/checkout@v2  #this is used for if you want to push all source code into runner       
        - name: update code base 
          working-directory: /test_pipe/www/html 
          run: sudo git pull origin master        
        - name: restart   
          working-directory: /test_pipe/www/html
          run: sudo systemctl restart nginx  

I have tried using exclude and ignore but with no luck.

2

Answers


  1. Something like that will just exclude markdown

    jobs:
      build:
        name: Lint Code Base
        runs-on: ubuntu-latest
        steps:
          - name: Checkout Code
            uses: actions/checkout@v3
            with:
              # Full git history is needed to get a proper list of changed files within `super-linter`
              fetch-depth: 0
          - name: Lint Code Base
            uses: github/super-linter@v4
            env:
              VALIDATE_ALL_CODEBASE: false
              DEFAULT_BRANCH: main
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              VALIDATE_MARKDOWN: false 
    
    Login or Signup to reply.
  2. According to github/super-linter‘s Filter linted files section, you can use the environment variables to include and exclude files i.e. FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE respectively.

    See its Environment variables section for more details.

    Apart from that, it provides VALIDATE_* variants of Boolean environment variables too to enable/disable linting per language so you can use VALIDATE_MARKDOWN: false and it should also work for your use case.


    Not sure why you’re using its with: exclusions or with: files inputs but https://github.com/github/super-linter/tree/v4.10.1 doesn’t list anything like that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search