name: Run deteKT

on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  detekt_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v4
        with:
          java-version: 11
          distribution: temurin
      - uses: gradle/gradle-build-action@v3
        with:
          gradle-version: wrapper
          arguments: |
            detektAll
            --build-cache
            -PgprUser=${{ github.actor }}
            -PgprKey=${{ secrets.GITHUB_TOKEN }}
