Skip to content

♻️ MegaLinter #1584

♻️ MegaLinter

♻️ MegaLinter #1584

# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: ♻️ MegaLinter
on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
# push: # Comment this line to trigger action only on pull-requests
pull_request:
branches: [main]
workflow_dispatch:
inputs:
lint_entire_codebase:
description: "Lint entire codebase?"
required: false
default: "false"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
# Remove the ones you do not need
contents: write
issues: write
pull-requests: write
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
# MegaLinter
- name: MegaLinter
id: ml
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/latest/flavors/
uses: oxsecurity/megalinter/flavors/python@32c1b3827a334c80026c654f31ee1b4801ad8798 # v7.12.0
env:
# All available variables are described in documentation
# https://megalinter.io/latest/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'workflow_dispatch' && inputs.lint_entire_codebase == 'true' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOS
# Upload MegaLinter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log