From edd9208982c35925302b348edb3ae6f14484207a Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com> Date: Sat, 7 Sep 2024 20:26:07 +0700 Subject: [PATCH] ci: upgrade superlinter from v5 to v7 --- .github/linters/.markdown-lint.yml | 2 +- .github/workflows/main.yml | 47 +++++++++++++++++------------- DEV.md | 6 ++-- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 50c97c9b..bdfd8d58 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -7,7 +7,7 @@ default: true # https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md007.md MD007: # Spaces for indent - indent: 4 + indent: 2 # MD013/line-length : Line length # https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md013.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56e1d807..4e6539ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,6 +68,9 @@ jobs: run-tests: true lintcheck: runs-on: ubuntu-latest + permissions: + contents: write + statuses: write steps: - name: Checkout source code uses: actions/checkout@v4 @@ -75,32 +78,36 @@ jobs: fetch-depth: 0 - name: Linting ## https://github.com/super-linter/super-linter#slim-image - uses: super-linter/super-linter/slim@v5 + uses: super-linter/super-linter/slim@v7 env: DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }} - VALIDATE_ALL_CODEBASE: false - IGNORE_GITIGNORED_FILES: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - YAML_CONFIG_FILE: .yamllint.yml - YAML_ERROR_ON_WARNING: true - # Disabled javascript/typescript as we have lint on rushjs - VALIDATE_JAVASCRIPT_ES: false - VALIDATE_JAVASCRIPT_STANDARD: false - VALIDATE_JSX: false - VALIDATE_TYPESCRIPT_ES: false - VALIDATE_TYPESCRIPT_STANDARD: false - VALIDATE_TSX: false - # Disabled json validation as issue #30 - VALIDATE_JSON: false - # The overrided config cannot resolve to correct path - # so we disabled it for now. - # For now, we only have single project using css linter - # so we will run it manually on local. - VALIDATE_CSS: false + IGNORE_GITIGNORED_FILES: true + IGNORE_GENERATED_FILES: true # For markdownlint, as it cannot exclude file from config file # exclude reviews file because it autogen file FILTER_REGEX_EXCLUDE: common/reviews/api/* + VALIDATE_ALL_CODEBASE: false + VALIDATE_CHECKOV: true + VALIDATE_EDITORCONFIG: true + VALIDATE_ENV: true + VALIDATE_GITHUB_ACTIONS: true + VALIDATE_GITLEAKS: true + VALIDATE_JSCPD: true + VALIDATE_NATURAL_LANGUAGE: true + VALIDATE_BASH: true + VALIDATE_BASH_EXEC: true + VALIDATE_SHELL_SHFMT: true + VALIDATE_XML: true + VALIDATE_JSON_PRETTIER: true + VALIDATE_JSONC: true + VALIDATE_MARKDOWN_PRETTIER: true + VALIDATE_MARKDOWN: true + VALIDATE_YAML: true + YAML_CONFIG_FILE: .yamllint.yml + YAML_ERROR_ON_WARNING: true + testing: runs-on: ubuntu-latest needs: @@ -120,7 +127,7 @@ jobs: with: command: test - name: Analysis packages - uses: SonarSource/sonarcloud-github-action@v2.1.1 + uses: SonarSource/sonarcloud-github-action@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/DEV.md b/DEV.md index 9b900bce..a4c6cb5f 100644 --- a/DEV.md +++ b/DEV.md @@ -2,10 +2,10 @@ ## Required features -- typescript / javascript +- TypeScript / JavaScript - lint-staged && husky (git-hooks) - linters - - eslint + - ESLint - prettier - commitlint && commitizen - test framework (select one) @@ -19,5 +19,5 @@ - package generator - release - conventional commits - - indenpendent versions + - independent versions - support release by GitHub Actions