Skip to content

Commit

Permalink
chore(ci): add MegaLinter workflow for code quality
Browse files Browse the repository at this point in the history
- Add GitHub Action workflow with MegaLinter for automated validation
- Configure specific linters:
  - YAML_PRETTIER for YAML formatting
  - KUBERNETES_HELM for Helm chart validation
  - KUBERNETES_KUBESCAPE for security scanning
  - KUBERNETES_KUBECONFORM for K8s manifest validation
  - SPELL_PROSELINT for prose linting
  - JSON_JSONLINT for JSON validation
  - MARKDOWN_MARKDOWNLINT for documentation

- Set up artifact upload for linter reports
- Exclude Chart.yaml and templates from YAML formatting
  • Loading branch information
sinadarbouy committed Nov 23, 2024
1 parent 0cd89bc commit 7d289e4
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint Code Base
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: MegaLinter
uses: oxsecurity/megalinter@v7
env:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_LINTERS: YAML_PRETTIER,KUBERNETES_HELM,KUBERNETES_KUBESCAPE,KUBERNETES_KUBECONFORM,SPELL_PROSELINT,JSON_JSONLINT,MARKDOWN_MARKDOWNLINT
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: .*(Chart\.yaml|templates/.*).*
- name: Archive MegaLinter reports
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log

0 comments on commit 7d289e4

Please sign in to comment.