name: "Code Scanning - Action"

on:
  pull_request:
    paths:
      - "**.go"
  push:
    branches: [ main ]
    paths:
      - "**.go"

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

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      # Initializes the CodeQL tools for scanning.
      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: 'go'
          queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality

      - name: Autobuild
        uses: github/codeql-action/autobuild@v3

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
