# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

name: "CodeQL"
on:
  push:
    branches:
      - "master"
  pull_request:
    branches:
      - "master"
  schedule:
    - cron: "44 11 * * 0"
  workflow_dispatch:

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-22.04
    timeout-minutes: 360
    permissions:
      security-events: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Initialize CodeQL
        uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
        with:
          languages: go
          build-mode: manual

      - run: go build ./...

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
        with:
          category: /language:go
