Installation & Quick Start
Integrating Super-Linter into your project is straightforward, especially with GitHub Actions. The primary method of installation is by using the official GitHub Action in your workflow.
Quick Start with GitHub Actions
To get started, create a new workflow file in your repository (e.g., .github/workflows/lint.yml
) with the following content:
---
name: Lint Code Base
on:
push:
branches-ignore:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0
- name: Super-Linter
uses: super-linter/super-linter@v8.0.0
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Key Workflow Steps Explained
on:
trigger: This example workflow runs onpull_request
events targeting themain
branch and onpush
events to any branch exceptmain
.permissions:
: The action requiresstatuses: write
permission to report its findings as status checks on your pull requests. Thecontents: read
andpackages: read
permissions are also necessary for checking out code and accessing the container image.actions/checkout@v4
: The checkout step includesfetch-depth: 0
. This is crucial because Super-Linter needs the full Git history to accurately determine which files have changed and lint them accordingly. Without the full history, it may fall back to linting the entire repository.super-linter/super-linter@v8.0.0
: This is the core step that runs the linter. It uses the specified version of the Super-Linter Docker image.GITHUB_TOKEN
: This environment variable is required to allow Super-Linter to post status checks back to your pull request.
Once you commit this workflow file, Super-Linter will automatically run on every new pull request and push to a feature branch, providing feedback directly in the "Checks" tab.
Super-Linter Variants
Super-Linter offers two container image variants to suit different needs. You can select a variant by changing the uses:
line in your workflow.
-
standard
(Default): Includes all supported linters. This is the most comprehensive option.yaml uses: super-linter/super-linter@v8.0.0
-
slim
: A smaller, faster image that excludes linters for certain ecosystems. Use this if your project does not contain Rust, .NET, or PowerShell/ARM templates.yaml uses: super-linter/super-linter/slim@v8.0.0
For a complete guide on running Super-Linter outside of GitHub Actions, see the Running Locally documentation.