name: Lint
on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:
jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set Golang
        uses: actions/setup-go@v5
        with:
          go-version: "1.20.x"
          cache: false

      - name: Check spelling with custom config file
        uses: crate-ci/typos@master
        with:
          config: ./.typos.toml

      - name: Get dependencies
        run: |
          go mod tidy
          go mod download

      - name: Lint
        uses: golangci/golangci-lint-action@v6
        with:
          version: latest
