name: linter

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

permissions:
  contents: read

jobs:
  golangci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
      - run: go install github.com/a-h/templ/cmd/templ@latest
      - run: make build
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v6.1.1
        with:
          version: latest
          only-new-issues: true
