name: golangci-lint
on:
  push:
    tags:
      - v*
    branches:
      - main
  pull_request:
permissions:
  contents: read

jobs:
  golangci:
    permissions:
      contents: read  # for actions/checkout to fetch code
      pull-requests: read  # for golangci/golangci-lint-action to fetch pull requests
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3
        with:
          go-version: '>=1.19.5'
      - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
      - name: golangci-lint
        uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3
        with:
          skip-go-installation: true
          args: --timeout=5m
