name: Code Scanning

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

permissions:
  contents: read

env:
  CGO_ENABLED: 0

jobs:
  CodeQL-Build:
    runs-on: ubuntu-latest
    permissions:
      security-events: write

    steps:
      - name: Check out code
        uses: actions/checkout@v4.1.0

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v2.22.2
        with:
          languages: go
          queries: security-and-quality

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v2.22.2
