github.com/anchore/syft@v1.38.2/.github/workflows/codeql-analysis.yml (about)

     1  # For most projects, this workflow file will not need changing; you simply need
     2  # to commit it to your repository.
     3  #
     4  # You may wish to alter this file to override the set of languages analyzed,
     5  # or to provide custom queries or build logic.
     6  name: "CodeQL Security Scan"
     7  
     8  on:
     9    push:
    10      branches:
    11        # only run when there are pushes to the main branch (not on PRs)
    12        - main
    13  
    14    schedule:
    15      - cron: '0 0 * * 3'
    16  
    17  permissions:
    18    contents: read
    19  
    20  jobs:
    21    analyze:
    22      name: Analyze
    23      runs-on: ubuntu-22.04-4core-16gb
    24      if: github.repository == 'anchore/syft' # only run for main repo
    25      permissions:
    26        security-events: write
    27  
    28      strategy:
    29        fail-fast: false
    30        matrix:
    31          # Override automatic language detection by changing the below list
    32          # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
    33          language: ['go', 'python']
    34          # Learn more...
    35          # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
    36  
    37      steps:
    38      - name: Checkout repository
    39        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
    40        with:
    41          persist-credentials: false
    42  
    43      - name: Install Go
    44        uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c #v6.1.0
    45        with:
    46          go-version-file: go.mod
    47  
    48      # Initializes the CodeQL tools for scanning.
    49      - name: Initialize CodeQL
    50        uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 #v3.29.5
    51        with:
    52          languages: ${{ matrix.language }}
    53          # If you wish to specify custom queries, you can do so here or in a config file.
    54          # By default, queries listed here will override any specified in a config file. 
    55          # Prefix the list here with "+" to use these queries and those in the config file.
    56          # queries: ./path/to/local/query, your-org/your-repo/queries@main
    57  
    58      # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
    59      # If this step fails, then you should remove it and run the build manually (see below)
    60      - name: Autobuild
    61        uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 #v3.29.5
    62  
    63      # â„šī¸ Command-line programs to run using the OS shell.
    64      # 📚 https://git.io/JvXDl
    65  
    66      # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines
    67      #    and modify them (or add more) to build your code if your project
    68      #    uses a compiled language
    69  
    70      #- run: |
    71      #   make bootstrap
    72      #   make release
    73  
    74      - name: Perform CodeQL Analysis
    75        uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 #v3.29.5