From 06e69ddb2b9b522f9fabef61a59969159acb74b0 Mon Sep 17 00:00:00 2001 From: liangbowen Date: Sat, 18 Mar 2023 21:54:45 +0800 Subject: [PATCH] [KYUUBI #4295] Introduce `super-linter` action for linting JSON, XML, ENV files and bash_exec ### _Why are the changes needed?_ - introduce `action/super-linter` with multiple linters, (https://github.com/marketplace/actions/super-linter) - using the smaller size version of image `github/super-linter/slim` for faster image pulling - enable linting for `bash_exec` for checking executable of bash scripts, with fixed `tools/spark-block-cleaner/kubernetes/docker/entrypoint.sh` - enable integrity checks for JSON files in JSONC style - enable integrity checks for XML files - enable linting for ENV files ### _How was this patch tested?_ - [x] Pass CI jobs Closes #4295 from bowenliang123/superlinter-action. Closes #4295 321d24912 [liangbowen] update 497bf801c [liangbowen] use JSONC instead of JSON to support comments 43787e233 [liangbowen] use superlinter Authored-by: liangbowen Signed-off-by: liangbowen --- .github/workflows/style.yml | 26 ++++++++++++++++++- .../kubernetes/docker/entrypoint.sh | 0 2 files changed, 25 insertions(+), 1 deletion(-) mode change 100644 => 100755 tools/spark-block-cleaner/kubernetes/docker/entrypoint.sh diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index bfaf22e2e..040cdfb3e 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -38,6 +38,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup JDK 8 uses: actions/setup-java@v3 with: @@ -104,10 +106,32 @@ jobs: echo "---------------------------------------------------------------------------------" shellcheck: - name: Shellcheck + name: Super Linter and Shellcheck runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - name: Super Linter Checks + uses: github/super-linter/slim@v4 + env: + CREATE_LOG_FILE: true + ERROR_ON_MISSING_EXEC_BIT: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IGNORE_GENERATED_FILES: true + IGNORE_GITIGNORED_FILES: true + LINTER_RULES_PATH: / + LOG_LEVEL: NOTICE + SUPPRESS_POSSUM: true + VALIDATE_BASH_EXEC: true + VALIDATE_ENV: true + VALIDATE_JSONC: true + VALIDATE_POWERSHELL: true + VALIDATE_XML: true + - name: Upload Super Linter logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: super-linter-log + path: super-linter.log - name: check bin directory uses: ludeeus/action-shellcheck@1.1.0 with: diff --git a/tools/spark-block-cleaner/kubernetes/docker/entrypoint.sh b/tools/spark-block-cleaner/kubernetes/docker/entrypoint.sh old mode 100644 new mode 100755