Add GitHub CI workflow for slim lint

This commit is contained in:
Sebastian Serth
2024-04-13 23:42:31 +02:00
committed by Dominic Sauer
parent 9a9efd5caa
commit 681e8ec444
4 changed files with 67 additions and 0 deletions

View File

@ -108,3 +108,33 @@ jobs:
skip_install: true
use_bundler: true
fail_on_error: true
slim-lint:
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Allow write access to checks to allow the action to annotate code in the PR.
checks: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Run slim-lint
run: bundle exec slim-lint app/views --reporter checkstyle > checkstyle-result.xml
- name: Upload slim-lint results as GitHub annotations
uses: lcollins/checkstyle-github-action@v2.0.0
if: ${{ success() || failure() }}
with:
name: Slim-Lint Report
title: Analyze Slim templates for linting issues
path: checkstyle-result.xml