# Lacan Scan — recommended consumer workflow.
# Source of truth for agents: https://jose-compu.github.io/lacan-scan/install-action.md
name: lacan

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read
  security-events: write

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: jose-compu/lacan-scan@v7
        with:
          path: .
          fail-on: HIGH
          output: sarif,cli
          sarif-file: lacan.sarif
          version: "7"
          changed-only: ${{ github.event_name == 'pull_request' }}
          changed-base: ${{ github.event.pull_request.base.sha }}
      - uses: github/codeql-action/upload-sarif@v4
        if: always() && hashFiles('lacan.sarif') != ''
        with:
          sarif_file: lacan.sarif
          category: lacan
