name: Licensed

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  workflow_dispatch:

jobs:
  validate-cached-dependency-records:
    runs-on: ubuntu-latest
    name: Check licenses
    steps:

      - name: Checkout
        uses: actions/checkout@v4

      - name: Install dependencies
        run: npm ci --ignore-scripts

      - name: Install licensed tool
        run: |
          brew install licensed@5.0.4

      - name: Check cached dependency records
        run: licensed status