name: golangci-lint
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  schedule:
    # Trigger every day at 16:00 UTC
    - cron: '0 16 * * *'
permissions:
  contents: read # to fetch code (actions/checkout)
  pull-requests: read # to fetch pull requests (golangci/golangci-lint-action)

jobs:
  golangci:
    name: lint-codebase
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v3
        with:
          go-version: '1.20'
      - uses: actions/checkout@v3
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: v1.51.0
          args: --timeout 15m0s --verbose --out-${NO_FUTURE}format tab
