diff --git a/.erb-lint.yml b/.erb-lint.yml index 105042f03..31bcfa563 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -1,5 +1,7 @@ --- EnableDefaultLinters: false +exclude: + - '**/vendor/**/*' linters: AllowedScriptType: enabled: true diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 000000000..7a78c3b7c --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,40 @@ +name: linters +on: [pull_request] + +permissions: + contents: read + +jobs: + linters: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: RuboCop + run: bundle exec rubocop --fail-level convention --display-only-fail-level-offenses -f github + - name: ERB Lint + run: bundle exec erblint . + - name: ESLint + run: npx eslint . --quiet + - name: Stylelint + run: npx stylelint app/assets/stylesheets + name: ${{ matrix.name }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - run: | + git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/* + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Setup NPM + uses: actions/setup-node@v4 + with: + cache: "npm" + node-version-file: ".node-version" + - name: Install node packages + run: npm clean-install + - name: ${{ matrix.name }} + run: ${{ matrix.run }} diff --git a/.github/workflows/pronto.yml b/.github/workflows/pronto.yml index 34eac27c7..e99175ac1 100644 --- a/.github/workflows/pronto.yml +++ b/.github/workflows/pronto.yml @@ -4,6 +4,7 @@ on: [pull_request] jobs: pronto: runs-on: ubuntu-latest + if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot' steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,9 +22,4 @@ jobs: - name: Install node packages run: npm clean-install - name: Run pronto - run: | - if [[ ${{ github.event.pull_request.head.repo.full_name }} == ${{ github.event.pull_request.base.repo.full_name }} && ${{ github.actor }} != dependabot ]]; then - PRONTO_PULL_REQUEST_ID="$(jq --raw-output .number "$GITHUB_EVENT_PATH")" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }} - else - bundle exec pronto run --exit-code -c origin/${{ github.base_ref }} - fi + run: PRONTO_PULL_REQUEST_ID="$(jq --raw-output .number "$GITHUB_EVENT_PATH")" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }} diff --git a/.rubocop.yml b/.rubocop.yml index 96d7572b5..e6ef500dc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,6 +11,7 @@ AllCops: Exclude: - "db/schema.rb" - "app/lib/ckeditor/backend/active_storage.rb" + - "vendor/**/*" DisabledByDefault: true Bundler/DuplicatedGem: