From 1531647e01655454c7a4c7bc38a9e62240157037 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 30 Jun 2025 03:21:47 +0300 Subject: [PATCH] feat(ci): use pr-lint action instead of reviewdog (#136) --- .github/workflows/changelog.yml | 2 +- .github/workflows/linters.yml | 66 +++++++-------------- .github/workflows/new-release.yml | 2 +- .github/workflows/pre-commit-autoupdate.yml | 4 +- .github/workflows/semantic-pr.yml | 2 +- .github/workflows/sync-labels.yml | 6 +- .github/workflows/update-submodules.yml | 2 +- .mega-linter.yml | 29 +++++++++ 8 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 .mega-linter.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 8afd080..934e9be 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Debug Changelog # Workflow name displayed on GitHub on: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index cccc3e4..65c09d4 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,8 +1,10 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json -name: Reviewdog +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Lint Code Base -on: [push] +on: + pull_request: + branches: [master, main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -11,50 +13,24 @@ concurrency: permissions: read-all jobs: - linters: - name: Linters - - runs-on: self-hosted - - permissions: write-all + Linter: + name: PR Lint + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + statuses: write + contents: read + packages: read steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Setup Node.js environment - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - - - name: GitHub Actions - uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2 + - name: Yarn Lock Changes + uses: Simek/yarn-lock-changes@34017425198654c20162a4dfd4f238fbece9636f # v0.12.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review + token: ${{ secrets.GITHUB_TOKEN }} - - name: detect-secrets - uses: reviewdog/action-detect-secrets@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review - - - name: markdownlint - uses: reviewdog/action-markdownlint@3667398db9118d7e78f7a63d10e26ce454ba5f58 # v0.26.2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review - - - name: shfmt - uses: reviewdog/action-shfmt@d8f080930b9be5847b4f97e9f4122b81a82aaeac # v1.0.4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - shfmt_flags: | - --find - --list - --write - --diff - --simplify - --language-dialect bash - --indent 2 - --binary-next-line - --case-indent - --space-redirects - --func-next-line + - name: Run PR Lint + # https://github.com/ivuorinen/actions + uses: ivuorinen/actions/pr-lint@9480614ba2231013d99dd5b9c730d2b105b9e160 # 25.6.25 \ No newline at end of file diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index db7efcc..d5a84cb 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Release Daily State on: diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index f90975c..06aa9ee 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Pre-commit autoupdate on: @@ -16,7 +16,7 @@ permissions: read-all jobs: auto-update: - runs-on: ubuntu-latest + runs-on: self-hosted permissions: contents: write diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index 0e0b2e2..5d37331 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Semantic PR on: diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 4cf4e2a..6f82e71 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Sync labels # yamllint disable-line rule:truthy @@ -23,10 +23,10 @@ permissions: read-all jobs: SyncLabels: - runs-on: ubuntu-latest + runs-on: self-hosted permissions: issues: write steps: - - uses: ivuorinen/actions/sync-labels@main + - uses: ivuorinen/actions/sync-labels@99f3911475dbb5b8d43d314b24c0882997433868 # 25.6.23 diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index 4236e94..f7c05aa 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -1,5 +1,5 @@ --- -# yaml-language-server: https://json.schemastore.org/github-workflow.json +# $schema: "https://json.schemastore.org/github-workflow.json" name: Update submodules on: diff --git a/.mega-linter.yml b/.mega-linter.yml new file mode 100644 index 0000000..49bd6ce --- /dev/null +++ b/.mega-linter.yml @@ -0,0 +1,29 @@ +--- +# Configuration file for MegaLinter +# See all available variables at +# https://megalinter.io/configuration/ and in linters documentation + +APPLY_FIXES: all +SHOW_ELAPSED_TIME: false # Show elapsed time at the end of MegaLinter run +PARALLEL: true +VALIDATE_ALL_CODEBASE: true +FILEIO_REPORTER: false # Generate file.io report +GITHUB_STATUS_REPORTER: true # Generate GitHub status report +IGNORE_GENERATED_FILES: true # Ignore generated files +JAVASCRIPT_DEFAULT_STYLE: prettier # Default style for JavaScript +PRINT_ALPACA: false # Print Alpaca logo in console +SARIF_REPORTER: true # Generate SARIF report +SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log +TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript + +DISABLE_LINTERS: + - REPOSITORY_DEVSKIM + +YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml +MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.json +JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json +TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json + +FILTER_REGEX_EXCLUDE: > + (node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins) +