on: [push, pull_request]
name: linter

permissions:
  contents: read
  pull-requests: read

jobs:
  lint:
    strategy:
      matrix:
        go-version: [1.x]
        platform: [ubuntu-latest]

        # golangci-lint will only process a single module, so we need to call it
        # separately for each module in the repo.  We dont lint example/newreposecretwithlibsodium
        # since that needs libsodium to run.
        working-directory:
          - ""
          - example
          - scrape
          - update-urls
    runs-on: ${{ matrix.platform }}

    steps:
    - uses: actions/checkout@v3

    - name: golangci-lint ${{ matrix.working-directory }}
      uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 #v3.3.1
      with:
        version: v1.44.0
        working-directory: ${{ matrix.working-directory}}
        args: --verbose
