name: Go Revive Lint

on:
  push:
    branches: [ "main", "master" ]
  pull_request:
    branches: [ "main", "master" ]

jobs:
  lint:
    permissions:
      contents: read
      pull-requests: read
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

    - name: Set up Go
      uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
      with:
        go-version: '1.25'

    - name: Setup Task
      uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
      with:
        version: '3.46.3'

    - name: Install revive
      run: go install github.com/mgechev/revive@latest

    - name: Run lint
      run: task lint
