name: Licenses Lint

on:
  push:
    branches:
      - master
    tags:
  pull_request:

permissions: read-all

jobs:
  licenses-lint:
    name: Licenses Lint
    timeout-minutes: 40
    runs-on: ubuntu-24.04
    steps:
      - name: Install Go
        uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
        with:
          go-version: 1.26.x
      - name: Checkout code
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - name: generate license mirror
        run: |
          make licenses-check
      - name: lint-licenses
        # if restricted > 0, CI will report an error.
        run: |
          make lint-licenses
