feat: megalinter

This commit is contained in:
auricom
2022-07-11 16:37:30 +02:00
parent 4f00357ec4
commit 2db0b9f49e

View File

@@ -2,13 +2,14 @@
name: Lint
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
branches:
- main
env:
# Currently no way to detect automatically
DEFAULT_BRANCH: main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
@@ -25,14 +26,47 @@ jobs:
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Lint
uses: github/super-linter/slim@v4
- name: MegaLinter
uses: oxsecurity/megalinter@v6.0.2
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: "${{ env.DEFAULT_BRANCH }}"
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"
ANSIBLE_CONFIG_FILE: .ansible-lint
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
TERRAFORM_TFLINT_CONFIG_FILE: .tflint.hcl
YAML_CONFIG_FILE: .yamllint.yaml
KUBERNETES_KUBEVAL_OPTIONS: --ignore-missing-schemas
PRINT_ALPACA: false
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'workflow_dispatch' }}
ENABLE_LINTERS: |-
${{
join(
fromJSON('
[
"ACTION_ACTIONLINT",
"ANSIBLE_ANSIBLE_LINT",
"COPYPASTE_JSCPD",
"CREDENTIALS_SECRETLINT",
"GIT_GIT_DIFF",
"KUBERNETES_KUBEVAL",
"MARKDOWN_MARKDOWNLINT",
"TERRAFORM_TERRAFORM_FMT",
"YAML_PRETTIER",
"YAML_YAMLLINT"
]
'),
','
)
}}
ANSIBLE_DIRECTORY: ansible
ANSIBLE_ANSIBLE_LINT_CONFIG_FILE: .ansible-lint
KUBERNETES_DIRECTORY: cluster
KUBERNETES_KUBEVAL_ARGUMENTS: --ignore-missing-schemas
KUBERNETES_KUBEVAL_FILTER_REGEX_INCLUDE: "(kubernetes)"
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .github/linters/.markdownlint.yaml
MARKDOWN_MARKDOWNLINT_RULES_PATH: .github/
YAML_YAMLLINT_CONFIG_FILE: .github/linters/.yamllint.yaml
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: "(.*\\.sops\\.ya?ml)"
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: MegaLinter reports
path: |
report
mega-linter.log